diff --git a/modules/proxy/mod_proxy_fcgi.c b/modules/proxy/mod_proxy_fcgi.c index 875153f..0a367b0 100644 --- a/modules/proxy/mod_proxy_fcgi.c +++ b/modules/proxy/mod_proxy_fcgi.c @@ -544,7 +544,8 @@ static void dump_header_to_log(request_rec *r, unsigned char fheader[], } static apr_status_t dispatch(proxy_conn_rec *conn, proxy_dir_conf *conf, - request_rec *r, apr_uint16_t request_id) + proxy_server_conf *sconf, request_rec *r, + apr_uint16_t request_id) { apr_bucket_brigade *ib, *ob; int seen_end_of_headers = 0, done = 0; @@ -569,14 +570,20 @@ static apr_status_t dispatch(proxy_conn_rec *conn, proxy_dir_conf *conf, ob = apr_brigade_create(r->pool, c->bucket_alloc); while (! done) { - apr_interval_time_t timeout = conn->worker->s->timeout; + apr_interval_time_t timeout; apr_size_t len; int n; /* We need SOME kind of timeout here, or virtually anything will * cause timeout errors. */ - if (! conn->worker->s->timeout_set) { - timeout = apr_time_from_sec(30); + if (conn->worker->s->timeout_set) { + timeout = conn->worker->s->timeout; + } + else if (sconf->timeout_set) { + timeout = sconf->timeout; + } + else { + timeout = r->server->timeout; } rv = apr_poll(&pfd, 1, &n, timeout); @@ -877,6 +884,7 @@ static int fcgi_do_request(apr_pool_t *p, request_rec *r, proxy_conn_rec *conn, conn_rec *origin, proxy_dir_conf *conf, + proxy_server_conf *sconf, apr_uri_t *uri, char *url, char *server_portstr) { @@ -907,7 +915,7 @@ static int fcgi_do_request(apr_pool_t *p, request_rec *r, } /* Step 3: Read records from the back end server and handle them. */ - rv = dispatch(conn, conf, r, request_id); + rv = dispatch(conn, conf, sconf, r, request_id); if (rv != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01075) "Error dispatching request to %s:", server_portstr); @@ -994,7 +1002,7 @@ static int proxy_fcgi_handler(request_rec *r, proxy_worker *worker, } /* Step Three: Process the Request */ - status = fcgi_do_request(p, r, backend, origin, dconf, uri, url, + status = fcgi_do_request(p, r, backend, origin, dconf, conf, uri, url, server_portstr); cleanup: