diff options
author | William A. Rowe Jr <wrowe@apache.org> | 2005-10-06 03:29:42 +0200 |
---|---|---|
committer | William A. Rowe Jr <wrowe@apache.org> | 2005-10-06 03:29:42 +0200 |
commit | 7e2a5490d174a33c3da70db17bc5d4e5a7a22cf9 (patch) | |
tree | 8cf157ab9c86f6d6a5d76f863cee50505514d801 /server/protocol.c | |
parent | Spare us a wasted variable, csd is initialized null, acting (diff) | |
download | apache2-7e2a5490d174a33c3da70db17bc5d4e5a7a22cf9.tar.xz apache2-7e2a5490d174a33c3da70db17bc5d4e5a7a22cf9.zip |
NET_TIME, as a standalone feature, was a horrid idea.
The core filter will NOT operate correctly across platforms
(even between Linux/Solaris) without setting up the conn->timeout,
so always apply the timeout when establishing the core filter.
The keep-alive-timeout is entirely an HTTP-ism, and needs to
move to the http protocol handler. Note #1; this isn't triggered
in the event mpm, but the event mpm introspects s->keep_alive_timeout
directly adding it to the pollset, so this is a non-sequitor.
Finally, once the headers are read, the named virtual host may
have a different (more/less permissive) timeout for the remainder
of the request body. This http-centric patch picks up that subtle
detail and can switch to a named-vhost timeout.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@306495 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | server/protocol.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/server/protocol.c b/server/protocol.c index 327adb63b8..e440ced174 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -832,6 +832,8 @@ request_rec *ap_read_request(conn_rec *conn) const char *expect; int access_status; apr_bucket_brigade *tmp_bb; + apr_socket_t *csd; + apr_interval_time_t cur_timeout; apr_pool_create(&p, conn->pool); apr_pool_tag(p, "request"); @@ -892,6 +894,17 @@ request_rec *ap_read_request(conn_rec *conn) return NULL; } + /* We may have been in keep_alive_timeout mode, so toggle back + * to the normal timeout mode as we fetch the header lines, + * as necessary. + */ + csd = ap_get_module_config(conn->conn_config, &core_module); + apr_socket_timeout_get(csd, &cur_timeout); + if (cur_timeout != conn->base_server->timeout) { + apr_socket_timeout_set(csd, conn->base_server->timeout); + cur_timeout = conn->base_server->timeout; + } + if (!r->assbackwards) { ap_get_mime_headers_core(r, tmp_bb); if (r->status != HTTP_REQUEST_TIME_OUT) { @@ -942,6 +955,14 @@ request_rec *ap_read_request(conn_rec *conn) */ ap_update_vhost_from_headers(r); + /* Toggle to the Host:-based vhost's timeout mode to fetch the + * request body and send the response body, if needed. + */ + if (cur_timeout != r->server->timeout) { + apr_socket_timeout_set(csd, r->server->timeout); + cur_timeout = r->server->timeout; + } + /* we may have switched to another server */ r->per_dir_config = r->server->lookup_defaults; |