mirror of
https://github.com/apache/httpd.git
synced 2025-08-07 04:02:58 +03:00
* Revert r703998.
The call to apr_socket_timeout_set before apr_socket_connect already sets the socket to non-blocking mode because the timeout of the socket is -1 after creation. A further call to apr_socket_timeout_set (after the connect call does not do this, because the old and the new timeout are >=0). The further code expects the socket to be in non-blocking mode, otherwise we have regressions with ssl. This can be notified by running t/ssl/proxy on 2.2.x which runs much much slower with the patch applied. This does not happen on trunk because the socket is set back to non blocking by the core output filter (async write completion). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@704753 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -2358,17 +2358,6 @@ PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function,
|
||||
"proxy: %s: fam %d socket created to connect to %s",
|
||||
proxy_function, backend_addr->family, worker->hostname);
|
||||
|
||||
/*
|
||||
* Temporarily set the socket to non blocking to make connection
|
||||
* timeouts (set via connectiontimeout) work.
|
||||
*/
|
||||
if ((rv = apr_socket_opt_set(newsock, APR_SO_NONBLOCK, 1))
|
||||
!= APR_SUCCESS) {
|
||||
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
|
||||
"apr_socket_opt_set(SO_NONBLOCK): Failed to set"
|
||||
" the socket to non blocking mode");
|
||||
}
|
||||
|
||||
/* make the connection out of the socket */
|
||||
rv = apr_socket_connect(newsock, backend_addr);
|
||||
|
||||
@@ -2385,13 +2374,6 @@ PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function,
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((rv = apr_socket_opt_set(newsock, APR_SO_NONBLOCK, 0))
|
||||
!= APR_SUCCESS) {
|
||||
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
|
||||
"apr_socket_opt_set(SO_NONBLOCK): Failed to set"
|
||||
" the socket to blocking mode");
|
||||
}
|
||||
|
||||
/* Set a timeout on the socket */
|
||||
if (worker->timeout_set == 1) {
|
||||
apr_socket_timeout_set(newsock, worker->timeout);
|
||||
|
Reference in New Issue
Block a user