httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject svn commit: r1204102 - in /httpd/httpd/branches/2.4.x: CHANGES modules/cache/mod_cache_disk.c modules/cache/mod_cache_disk.h
Date Sat, 19 Nov 2011 23:05:47 GMT
Author: minfrin
Date: Sat Nov 19 23:05:46 2011
New Revision: 1204102

URL: http://svn.apache.org/viewvc?rev=1204102&view=rev
Log:
Backport:
mod_cache_disk: Remove the unnecessary intermediate brigade while
writing to disk. Fixes a problem where mod_disk_cache was leaving 
buckets in the intermediate brigade and not passing them to out on 
exit.

Modified:
    httpd/httpd/branches/2.4.x/CHANGES
    httpd/httpd/branches/2.4.x/modules/cache/mod_cache_disk.c
    httpd/httpd/branches/2.4.x/modules/cache/mod_cache_disk.h

Modified: httpd/httpd/branches/2.4.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/CHANGES?rev=1204102&r1=1204101&r2=1204102&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.4.x/CHANGES [utf-8] Sat Nov 19 23:05:46 2011
@@ -1,6 +1,11 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.4.0
 
+  *) mod_cache_disk: Remove the unnecessary intermediate brigade while
+     writing to disk. Fixes a problem where mod_disk_cache was leaving
+     buckets in the intermediate brigade and not passing them to out on
+     exit. [Florian S. <f_los_ch@yahoo.com>, Graham Leggett]
+
   *) mod_ssl: use a shorter setting for SSLCipherSuite in the default
      default configuration file, and add some more information about
      configuring a speed-optimized alternative.

Modified: httpd/httpd/branches/2.4.x/modules/cache/mod_cache_disk.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/cache/mod_cache_disk.c?rev=1204102&r1=1204101&r2=1204102&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/cache/mod_cache_disk.c (original)
+++ httpd/httpd/branches/2.4.x/modules/cache/mod_cache_disk.c Sat Nov 19 23:05:46 2011
@@ -1075,9 +1075,6 @@ static apr_status_t store_body(cache_han
     disk_cache_dir_conf *dconf = ap_get_module_config(r->per_dir_config, &cache_disk_module);
     int seen_eos = 0;
 
-    if (!dobj->bb) {
-        dobj->bb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
-    }
     if (!dobj->offset) {
         dobj->offset = dconf->readsize;
     }
@@ -1107,7 +1104,6 @@ static apr_status_t store_body(cache_han
             seen_eos = 1;
             dobj->done = 1;
             APR_BUCKET_REMOVE(e);
-            APR_BRIGADE_CONCAT(out, dobj->bb);
             APR_BRIGADE_INSERT_TAIL(out, e);
             break;
         }
@@ -1115,7 +1111,6 @@ static apr_status_t store_body(cache_han
         /* honour flush buckets, we'll get called again */
         if (APR_BUCKET_IS_FLUSH(e)) {
             APR_BUCKET_REMOVE(e);
-            APR_BRIGADE_CONCAT(out, dobj->bb);
             APR_BRIGADE_INSERT_TAIL(out, e);
             break;
         }
@@ -1123,21 +1118,20 @@ static apr_status_t store_body(cache_han
         /* metadata buckets are preserved as is */
         if (APR_BUCKET_IS_METADATA(e)) {
             APR_BUCKET_REMOVE(e);
-            APR_BRIGADE_INSERT_TAIL(dobj->bb, e);
+            APR_BRIGADE_INSERT_TAIL(out, e);
             continue;
         }
 
         /* read the bucket, write to the cache */
         rv = apr_bucket_read(e, &str, &length, APR_BLOCK_READ);
         APR_BUCKET_REMOVE(e);
-        APR_BRIGADE_INSERT_TAIL(dobj->bb, e);
+        APR_BRIGADE_INSERT_TAIL(out, e);
         if (rv != APR_SUCCESS) {
             ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                     "cache_disk: Error when reading bucket for URL %s",
                     h->cache_obj->key);
             /* Remove the intermediate cache file and return non-APR_SUCCESS */
             apr_pool_destroy(dobj->data.pool);
-            APR_BRIGADE_CONCAT(out, dobj->bb);
             return rv;
         }
 
@@ -1156,7 +1150,6 @@ static apr_status_t store_body(cache_han
                                  APR_BUFFERED | APR_EXCL, dobj->data.pool);
             if (rv != APR_SUCCESS) {
                 apr_pool_destroy(dobj->data.pool);
-                APR_BRIGADE_CONCAT(out, dobj->bb);
                 return rv;
             }
             dobj->file_size = 0;
@@ -1164,7 +1157,6 @@ static apr_status_t store_body(cache_han
                     dobj->data.tempfd);
             if (rv != APR_SUCCESS) {
                 apr_pool_destroy(dobj->data.pool);
-                APR_BRIGADE_CONCAT(out, dobj->bb);
                 return rv;
             }
             dobj->disk_info.device = finfo.device;
@@ -1180,7 +1172,6 @@ static apr_status_t store_body(cache_han
                     h->cache_obj->key);
             /* Remove the intermediate cache file and return non-APR_SUCCESS */
             apr_pool_destroy(dobj->data.pool);
-            APR_BRIGADE_CONCAT(out, dobj->bb);
             return rv;
         }
         dobj->file_size += written;
@@ -1191,7 +1182,6 @@ static apr_status_t store_body(cache_han
                     h->cache_obj->key, dobj->file_size, dconf->maxfs);
             /* Remove the intermediate cache file and return non-APR_SUCCESS */
             apr_pool_destroy(dobj->data.pool);
-            APR_BRIGADE_CONCAT(out, dobj->bb);
             return APR_EGENERAL;
         }
 
@@ -1203,12 +1193,10 @@ static apr_status_t store_body(cache_han
         dobj->offset -= length;
         if (dobj->offset <= 0) {
             dobj->offset = 0;
-            APR_BRIGADE_CONCAT(out, dobj->bb);
             break;
         }
         if ((dconf->readtime && apr_time_now() > dobj->timeout)) {
             dobj->timeout = 0;
-            APR_BRIGADE_CONCAT(out, dobj->bb);
             break;
         }
 

Modified: httpd/httpd/branches/2.4.x/modules/cache/mod_cache_disk.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/cache/mod_cache_disk.h?rev=1204102&r1=1204101&r2=1204102&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/cache/mod_cache_disk.h (original)
+++ httpd/httpd/branches/2.4.x/modules/cache/mod_cache_disk.h Sat Nov 19 23:05:46 2011
@@ -49,7 +49,6 @@ typedef struct disk_cache_object {
     const char *key;             /* On-disk prefix; URI with Vary bits (if present) */
     apr_off_t file_size;         /*  File size of the cached data file  */
     disk_cache_info_t disk_info; /* Header information. */
-    apr_bucket_brigade *bb;      /* Set aside brigade */
     apr_table_t *headers_in;     /* Input headers to save */
     apr_table_t *headers_out;    /* Output headers to save */
     apr_off_t offset;            /* Max size to set aside */



Mime
View raw message