summaryrefslogtreecommitdiffstats
path: root/modules/proxy/proxy_util.c
diff options
context:
space:
mode:
authorRuediger Pluem <rpluem@apache.org>2008-08-09 22:52:46 +0200
committerRuediger Pluem <rpluem@apache.org>2008-08-09 22:52:46 +0200
commitb4e20c8e556d346039e8336870059d73ebe9a7ec (patch)
tree090ad376c6918a69eac0e1cc96ac925f88c94cc9 /modules/proxy/proxy_util.c
parent* Improve timeout documentation even more (diff)
downloadapache2-b4e20c8e556d346039e8336870059d73ebe9a7ec.tar.xz
apache2-b4e20c8e556d346039e8336870059d73ebe9a7ec.zip
* Add the possibility to set a separate connection timeout for backend
workers. PR: 45445 Submitted by: rahul <rahul sun.com> Reviewed by: rpluem git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@684341 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/proxy/proxy_util.c')
-rw-r--r--modules/proxy/proxy_util.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c
index 2103b41049..2a55c5bcac 100644
--- a/modules/proxy/proxy_util.c
+++ b/modules/proxy/proxy_util.c
@@ -2325,8 +2325,11 @@ PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function,
"Failed to set");
}
- /* Set a timeout on the socket */
- if (worker->timeout_set == 1) {
+ /* Set a timeout for connecting to the backend on the socket */
+ if (worker->conn_timeout_set) {
+ apr_socket_timeout_set(newsock, worker->conn_timeout);
+ }
+ else if (worker->timeout_set == 1) {
apr_socket_timeout_set(newsock, worker->timeout);
}
else if (conf->timeout_set == 1) {
@@ -2364,6 +2367,17 @@ PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function,
continue;
}
+ /* Set a timeout on the socket */
+ if (worker->timeout_set == 1) {
+ apr_socket_timeout_set(newsock, worker->timeout);
+ }
+ else if (conf->timeout_set == 1) {
+ apr_socket_timeout_set(newsock, conf->timeout);
+ }
+ else {
+ apr_socket_timeout_set(newsock, s->timeout);
+ }
+
conn->sock = newsock;
connected = 1;
}