From: Garrett Rooney Date: Sun, 5 Mar 2006 07:30:50 +0000 (+0000) Subject: Don't just hardcode 30 seconds as the poll timeout. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc5a7b4bf224b4b3458206b88ffa08d9cc2c390e;p=thirdparty%2Fapache%2Fhttpd.git Don't just hardcode 30 seconds as the poll timeout. * modules/proxy/mod_proxy_fcgi.c (dispatch): Use the worker timeout for our polls, falling back to the old behavior of 30 seconds if there is no worker timeout set. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/fcgi-proxy-dev@383292 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/mod_proxy_fcgi.c b/modules/proxy/mod_proxy_fcgi.c index 8917986e6cb..0ea4c7674df 100644 --- a/modules/proxy/mod_proxy_fcgi.c +++ b/modules/proxy/mod_proxy_fcgi.c @@ -519,11 +519,17 @@ static apr_status_t dispatch(proxy_conn_rec *conn, request_rec *r, ob = apr_brigade_create(r->pool, c->bucket_alloc); while (! done) { + apr_interval_time_t timeout = conn->worker->timeout; apr_size_t len; int n; - /* XXX don't hardcode 30 seconds */ - rv = apr_poll(&pfd, 1, &n, apr_time_from_sec(30)); + /* We need SOME kind of timeout here, or virtually anything will + * cause timeout errors. */ + if (! conn->worker->timeout_set) { + timeout = apr_time_from_sec(30); + } + + rv = apr_poll(&pfd, 1, &n, timeout); if (rv != APR_SUCCESS) { break; }