]> granicus.if.org Git - apache/commitdiff
Don't open for business before the cache objec is fully initialized.
authorBill Stoddard <stoddard@apache.org>
Fri, 3 May 2002 19:09:28 +0000 (19:09 +0000)
committerBill Stoddard <stoddard@apache.org>
Fri, 3 May 2002 19:09:28 +0000 (19:09 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94919 13f79535-47bb-0310-9956-ffa450edef68

modules/experimental/mod_mem_cache.c

index 557f6f521cf3cae089dae3c4da81fc7871bccef4..5ccbc412435460d7683d26036840ff13728096f1 100644 (file)
@@ -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,