]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1756852, r1756853 from trunk:
authorJim Jagielski <jim@apache.org>
Tue, 6 Sep 2016 17:35:54 +0000 (17:35 +0000)
committerJim Jagielski <jim@apache.org>
Tue, 6 Sep 2016 17:35:54 +0000 (17:35 +0000)
Be more consistent when we alocate this brigade.
This should save a few bytes in case of early exit and is, IMHO, cleaner.

Fix some style (spaces only)
Submitted by: jailletc36
Reviewed/backported by: jim

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

STATUS
modules/proxy/mod_proxy_connect.c

diff --git a/STATUS b/STATUS
index 235a8db3c1dc704df595c90dbc61de26155f3f21..cfd7704f747653f5e071d79361cd10e1d4274e1c 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -131,13 +131,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
      2.4.x patch: trunk works
      +1: jchampion, wrowe, covener
 
-   * mod_proxy_connect: Delay some memory allocation
-                        Fix some style (space only)
-     trunk patch: http://svn.apache.org/r1756852
-                  http://svn.apache.org/r1756853
-     2.4.x patch: trunk works
-     +1: jailletc36, jchampion, covener
-
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
 
index 6e32af06b08f5d085322c0eba4bb96ac089eaf91..1984342a377bc3ecd9908ad76f9b4ad02d405474 100644 (file)
@@ -119,7 +119,7 @@ static int allowed_port(connect_conf *conf, int port)
     int i;
     port_range *list = (port_range *) conf->allowed_connect_ports->elts;
 
-    if (apr_is_empty_array(conf->allowed_connect_ports)){
+    if (apr_is_empty_array(conf->allowed_connect_ports)) {
         return port == APR_URI_HTTPS_DEFAULT_PORT
                || port == APR_URI_SNEWS_DEFAULT_PORT;
     }
@@ -158,7 +158,7 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker,
     conn_rec *backconn;
     int done = 0;
 
-    apr_bucket_brigade *bb_front = apr_brigade_create(p, c->bucket_alloc);
+    apr_bucket_brigade *bb_front;
     apr_bucket_brigade *bb_back;
     apr_status_t rv;
     apr_size_t nbytes;
@@ -227,9 +227,9 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker,
                   connectname, connectport);
 
     /* Check if it is an allowed port */
-    if(!allowed_port(c_conf, uri.port)) {
-              return ap_proxyerror(r, HTTP_FORBIDDEN,
-                                   "Connect to remote machine blocked");
+    if (!allowed_port(c_conf, uri.port)) {
+        return ap_proxyerror(r, HTTP_FORBIDDEN,
+                             "Connect to remote machine blocked");
     }
 
     /*
@@ -315,6 +315,7 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker,
                    backconn->local_addr->port));
 
 
+    bb_front = apr_brigade_create(p, c->bucket_alloc);
     bb_back = apr_brigade_create(p, backconn->bucket_alloc);
 
     /* If we are connecting through a remote proxy, we need to pass