]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
proxy: in proxy tunnels, use the smaller timeout value of
authorStefan Eissing <icing@apache.org>
Fri, 30 Jun 2023 09:08:23 +0000 (09:08 +0000)
committerStefan Eissing <icing@apache.org>
Fri, 30 Jun 2023 09:08:23 +0000 (09:08 +0000)
       client and origin as timeout for polling the tunnel.

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

modules/proxy/proxy_util.c

index 750714560f05d87f6fad516308c4e41265dba3e9..1d705f98283565c7ac80664d1488e5ccb48494fd 100644 (file)
@@ -4921,9 +4921,9 @@ PROXY_DECLARE(apr_status_t) ap_proxy_tunnel_create(proxy_tunnel_rec **ptunnel,
     apr_socket_timeout_get(tunnel->origin->pfd->desc.s, &origin_timeout);
     apr_socket_opt_set(tunnel->origin->pfd->desc.s, APR_SO_NONBLOCK, 1);
 
-    /* Defaults to the biggest timeout of both connections */
-    tunnel->timeout = (origin_timeout >= 0 && origin_timeout > client_timeout)?
-                      origin_timeout : client_timeout;
+    /* Defaults to the smallest timeout of both connections */
+    tunnel->timeout = (client_timeout >= 0 && client_timeout < origin_timeout ?
+                       client_timeout : origin_timeout);
 
     /* Bidirectional non-HTTP stream will confuse mod_reqtimeoout */
     ap_remove_input_filter_byhandle(c_i->input_filters, "reqtimeout");