]> granicus.if.org Git - apache/commitdiff
Fix a pool lifetime issue: Make sure we clean up our brigade before we
authorGraham Leggett <minfrin@apache.org>
Thu, 4 Nov 2010 08:37:13 +0000 (08:37 +0000)
committerGraham Leggett <minfrin@apache.org>
Thu, 4 Nov 2010 08:37:13 +0000 (08:37 +0000)
hand the backend connection back to the connection pool.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1030855 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy_http.c

index 9454758d71e0bc5878955bdbf0d819dcf486bdd6..e2204a6c93dbcf6569c9d505fddabc02ce44d9f8 100644 (file)
@@ -1902,9 +1902,10 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
 
                     /* Switch the allocator lifetime of the buckets */
                     ap_proxy_buckets_lifetime_transform(r, bb, pass_bb);
+                    apr_brigade_cleanup(bb);
 
                     /* found the last brigade? */
-                    if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(bb))) {
+                    if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(pass_bb))) {
 
                         /* signal that we must leave */
                         finish = TRUE;
@@ -1928,7 +1929,6 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
                     }
 
                     /* make sure we always clean up after ourselves */
-                    apr_brigade_cleanup(bb);
                     apr_brigade_cleanup(pass_bb);
 
                 } while (!finish);