Commit 3f1bfe5d authored by Jeff Trawick's avatar Jeff Trawick
Browse files

Fix some APR-ization issues:

1) we're using an apr_time_t file mtime, but trying to fit it in
   a time_t entry in the cache and in parameters to the cache
   access routines; use apr_time_t everywhere

2) we need to use apr_fileperms_t instead of mode_t for APR
   file permissions

PR:		6980


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88443 13f79535-47bb-0310-9956-ffa450edef68
parent 7f0c25d8
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -3056,7 +3056,7 @@ static void open_rewritelog(server_rec *s, apr_pool_t *p)
    apr_status_t rc;
    piped_log *pl;
    int    rewritelog_flags = ( APR_WRITE | APR_APPEND | APR_CREATE );
    mode_t rewritelog_mode  = ( APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD );
    apr_fileperms_t rewritelog_mode  = ( APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD );

    conf = ap_get_module_config(s->module_config, &rewrite_module);

@@ -3626,7 +3626,7 @@ static cache *init_cache(apr_pool_t *p)
    return c;
}

static void set_cache_string(cache *c, const char *res, int mode, time_t t,
static void set_cache_string(cache *c, const char *res, int mode, apr_time_t t,
                             char *key, char *value)
{
    cacheentry ce;
@@ -3639,7 +3639,7 @@ static void set_cache_string(cache *c, const char *res, int mode, time_t t,
}

static char *get_cache_string(cache *c, const char *res, int mode,
                              time_t t, char *key)
                              apr_time_t t, char *key)
{
    cacheentry *ce;

+3 −7
Original line number Diff line number Diff line
@@ -114,10 +114,6 @@

#include "ap_config.h"

#ifdef HAVE_TIME_H
#include <time.h>
#endif

    /* Include from the Apache server ... */
#define CORE_PRIVATE
#include "httpd.h"
@@ -304,7 +300,7 @@ typedef struct {
     * a 4-way hash apr_table_t with LRU functionality
     */
typedef struct cacheentry {
    time_t time;
    apr_time_t time;
    char  *key;
    char  *value;
} cacheentry;
@@ -452,9 +448,9 @@ static char *lookup_header(request_rec *r, const char *name);

    /* caching functions */
static cache *init_cache(apr_pool_t *p);
static char  *get_cache_string(cache *c, const char *res, int mode, time_t mtime,
static char  *get_cache_string(cache *c, const char *res, int mode, apr_time_t mtime,
                               char *key);
static void   set_cache_string(cache *c, const char *res, int mode, time_t mtime,
static void   set_cache_string(cache *c, const char *res, int mode, apr_time_t mtime,
                               char *key, char *value);
static cacheentry *retrieve_cache_string(cache *c, const char *res, char *key);
static void   store_cache_string(cache *c, const char *res, cacheentry *ce);