diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 6fe94ea770..45eef5a8cf 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -2278,6 +2278,7 @@ PROXY_DECLARE(int) ap_proxy_connection_create(const char *proxy_function, { apr_sockaddr_t *backend_addr = conn->addr; int rc; + apr_interval_time_t current_timeout; /* * The socket is now open, create a new backend server connection @@ -2327,6 +2328,12 @@ PROXY_DECLARE(int) ap_proxy_connection_create(const char *proxy_function, "proxy: %s: connection complete to %pI (%s)", proxy_function, backend_addr, conn->hostname); + /* + * save the timout of the socket because core_pre_connection + * will set it to base_server->timeout + * (core TimeOut directive). + */ + apr_socket_timeout_get(conn->sock, ¤t_timeout); /* set up the connection filters */ rc = ap_run_pre_connection(conn->connection, conn->sock); if (rc != OK && rc != DONE) { @@ -2336,6 +2343,7 @@ PROXY_DECLARE(int) ap_proxy_connection_create(const char *proxy_function, proxy_function, rc); return rc; } + apr_socket_timeout_set(conn->sock, current_timeout); return OK; }