]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge of r1901088 from trunk:
authorStefan Eissing <icing@apache.org>
Wed, 25 May 2022 11:49:56 +0000 (11:49 +0000)
committerStefan Eissing <icing@apache.org>
Wed, 25 May 2022 11:49:56 +0000 (11:49 +0000)
  *) mod_proxy_connect: Ensure that the configured timeout is set on the
     backend socket.
     Trunk version of patch:
        https://svn.apache.org/r1901088
     Backport version for 2.4.x of patch:
      Trunk version of patch works
      svn merge -c 1901088 ^/httpd/httpd/trunk .

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

STATUS
modules/proxy/mod_proxy_connect.c

diff --git a/STATUS b/STATUS
index 5d2b2cec90b76abebc04fc72074aaf37744b8dd1..33280a4d405d561b3872c868bc5c8a44dfc80ea5 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -148,15 +148,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) mod_proxy_connect: Ensure that the configured timeout is set on the
-     backend socket.
-     Trunk version of patch:
-        https://svn.apache.org/r1901088
-     Backport version for 2.4.x of patch:
-      Trunk version of patch works
-      svn merge -c 1901088 ^/httpd/httpd/trunk .
-     +1: rpluem, jorton, icing
-
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
index 2d05d11673544c76a982c8e4279ceb259e6ef492..5a681350f095ae416416093b4b603cd8fbe118f6 100644 (file)
@@ -170,6 +170,8 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker,
     apr_port_t connectport = 0;
     apr_sockaddr_t *nexthop;
 
+    apr_interval_time_t current_timeout;
+
     /* is this for us? */
     if (r->method_number != M_CONNECT) {
         ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "declining URL %s", url);
@@ -272,6 +274,13 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker,
         return HTTP_INTERNAL_SERVER_ERROR;
     }
     ap_proxy_ssl_engine(backconn, r->per_dir_config, 0);
+
+    /*
+     * save the timeout of the socket because core_pre_connection
+     * will set it to base_server->timeout
+     * (core TimeOut directive).
+     */
+    apr_socket_timeout_get(sock, &current_timeout);
     rc = ap_run_pre_connection(backconn, sock);
     if (rc != OK && rc != DONE) {
         backconn->aborted = 1;
@@ -280,6 +289,7 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker,
         apr_socket_close(sock);
         return HTTP_INTERNAL_SERVER_ERROR;
     }
+    apr_socket_timeout_set(sock, current_timeout);
 
     ap_log_rerror(APLOG_MARK, APLOG_TRACE3, 0, r,
                   "connection complete to %pI (%s)",