From 751037850c3a1749390f021b507a62731d1031ff Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Fri, 3 May 2002 19:09:28 +0000 Subject: [PATCH] Don't open for business before the cache objec is fully initialized. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94919 13f79535-47bb-0310-9956-ffa450edef68 --- modules/experimental/mod_mem_cache.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/experimental/mod_mem_cache.c b/modules/experimental/mod_mem_cache.c index 557f6f521c..5ccbc41243 100644 --- a/modules/experimental/mod_mem_cache.c +++ b/modules/experimental/mod_mem_cache.c @@ -728,6 +728,7 @@ static apr_status_t write_body(cache_handle_t *h, request_rec *r, apr_bucket_bri apr_read_type_e eblock = APR_BLOCK_READ; apr_bucket *e; char *cur; + int eos = 0; if (mobj->type == CACHE_TYPE_FILE) { apr_file_t *file = NULL; @@ -741,7 +742,7 @@ static apr_status_t write_body(cache_handle_t *h, request_rec *r, apr_bucket_bri */ APR_BRIGADE_FOREACH(e, b) { if (APR_BUCKET_IS_EOS(e)) { - obj->complete = 1; + eos = 1; } else if (APR_BUCKET_IS_FILE(e)) { apr_bucket_file *a = e->data; @@ -752,7 +753,7 @@ static apr_status_t write_body(cache_handle_t *h, request_rec *r, apr_bucket_bri other++; } } - if (fd == 1 && !other && obj->complete) { + if (fd == 1 && !other && eos) { apr_file_t *tmpfile; /* Open a new XTHREAD handle to the file */ rv = apr_file_open(&tmpfile, r->filename, -- 2.40.0