]> granicus.if.org Git - apache/commitdiff
Merge r1572543 from trunk:
authorJim Jagielski <jim@apache.org>
Sun, 2 Mar 2014 20:18:03 +0000 (20:18 +0000)
committerJim Jagielski <jim@apache.org>
Sun, 2 Mar 2014 20:18:03 +0000 (20:18 +0000)
Cleanup the client to backend brigade before returning an error (if any) to avoid buckets lifetime issues (backend connection's pool destroyed before request's one). PR 50335.
Suggested by rpluem.

Submitted by: ylavic
Reviewed/backported by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1573359 13f79535-47bb-0310-9956-ffa450edef68

STATUS
modules/proxy/proxy_util.c

diff --git a/STATUS b/STATUS
index 1140a088f1e0cd536bc9876ac35eca616869ca3e..cbde2250f17d4c2971e9392e8dff82c7a4991739 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -98,14 +98,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-   * mod_proxy: Cleanup the client to backend brigade before returning an error
-                (if any) to avoid buckets lifetime issues (backend connection's
-                pool destroyed before request's one). PR 50335.
-                Follows up r1534321 and r1550061 already backported to 2.4.8.
-     trunk patch: http://svn.apache.org/r1572543
-     2.4.x patch: trunk works
-     +1: ylavic, jim, rpluem
-
    * mod_ssl: Remove the hardcoded algorithm-type dependency for the
      SSLCertificateFile and SSLCertificateKeyFile directives, and deprecate
      SSLCertificateChainFile. A detailed list of the changes is included
index 526c7e1cf95c120f3f3227e1e47ed199d7212df9..d05f0cdcce148b9051236f4cea6da717ec6ef6c6 100644 (file)
@@ -3372,6 +3372,9 @@ PROXY_DECLARE(int) ap_proxy_pass_brigade(apr_bucket_alloc_t *bucket_alloc,
     if (transferred != -1)
         p_conn->worker->s->transferred += transferred;
     status = ap_pass_brigade(origin->output_filters, bb);
+    /* Cleanup the brigade now to avoid buckets lifetime
+     * issues in case of error returned below. */
+    apr_brigade_cleanup(bb);
     if (status != APR_SUCCESS) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r, APLOGNO(01084)
                       "pass request body failed to %pI (%s)",
@@ -3391,7 +3394,6 @@ PROXY_DECLARE(int) ap_proxy_pass_brigade(apr_bucket_alloc_t *bucket_alloc,
             return HTTP_BAD_REQUEST;
         }
     }
-    apr_brigade_cleanup(bb);
     return OK;
 }