From: Jeff Trawick Date: Sat, 3 Mar 2001 01:46:16 +0000 (+0000) Subject: Fix some APR-ization issues: X-Git-Tag: 2.0.14~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=01dd97bd88456f62b5f44100aa5a935a56fdedb3;p=apache 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 --- diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index 8e1e77656c..4adddc50d0 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -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; diff --git a/modules/mappers/mod_rewrite.h b/modules/mappers/mod_rewrite.h index 7d2ca24d06..f139877978 100644 --- a/modules/mappers/mod_rewrite.h +++ b/modules/mappers/mod_rewrite.h @@ -114,10 +114,6 @@ #include "ap_config.h" -#ifdef HAVE_TIME_H -#include -#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);