Return-Path: Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 59120 invoked by uid 500); 11 Dec 2002 22:31:29 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 59109 invoked by uid 500); 11 Dec 2002 22:31:29 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Date: 11 Dec 2002 22:31:28 -0000 Message-ID: <20021211223128.16440.qmail@icarus.apache.org> From: stoddard@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0/modules/experimental mod_cache.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N stoddard 2002/12/11 14:31:28 Modified: modules/experimental mod_cache.c Log: A few more lazy initializations. No function change (I hope :-) Revision Changes Path 1.69 +9 -14 httpd-2.0/modules/experimental/mod_cache.c Index: mod_cache.c =================================================================== RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_cache.c,v retrieving revision 1.68 retrieving revision 1.69 diff -u -r1.68 -r1.69 --- mod_cache.c 11 Dec 2002 21:53:22 -0000 1.68 +++ mod_cache.c 11 Dec 2002 22:31:28 -0000 1.69 @@ -418,23 +418,16 @@ { int rv; request_rec *r = f->r; + cache_request_rec *cache; + cache_server_conf *conf; char *url = r->unparsed_uri; const char *cc_out; const char *exps, *lastmods, *dates, *etag; apr_time_t exp, date, lastmod, now; apr_off_t size; cache_info *info; - void *sconf = r->server->module_config; - cache_server_conf *conf = - (cache_server_conf *) ap_get_module_config(sconf, &cache_module); - void *scache = r->request_config; - cache_request_rec *cache = - (cache_request_rec *) ap_get_module_config(scache, &cache_module); - apr_bucket *split_point = NULL; - - ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, f->r->server, - "cache: running CACHE_IN filter"); + apr_bucket *split_point = NULL; /* check first whether running this filter has any point or not */ if(r->no_cache) { @@ -442,10 +435,11 @@ return ap_pass_brigade(f->next, in); } - /* make space for the per request config - * We hit this code path when CACHE_IN has been installed by someone - * other than the cache handler - */ + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, + "cache: running CACHE_IN filter"); + + /* Setup cache_request_rec */ + cache = (cache_request_rec *) ap_get_module_config(r->request_config, &cache_module); if (!cache) { cache = apr_pcalloc(r->pool, sizeof(cache_request_rec)); ap_set_module_config(r->request_config, &cache_module, cache); @@ -516,6 +510,7 @@ lastmod = APR_DATE_BAD; } + conf = (cache_server_conf *) ap_get_module_config(r->server->module_config, &cache_module); /* read the etag and cache-control from the entity */ etag = apr_table_get(r->headers_out, "Etag"); cc_out = apr_table_get(r->headers_out, "Cache-Control");