On Thu, 08 Nov 2001 14:55:58 -0800, Tom Gilbert wrote:
> --OXfL5xGRrasGEqWY > Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > > Rewritten for 2.0, even smaller patch this time, but for me and several > others this directive would be really, really useful. > > CVS diff attached as of Thu Nov 8 22:51:21 GMT 2001. > > Tom. can anyone see any problems with this? I want to do something similiar to this on the proxy side so that differing proxyPass'es can have different timeouts. .Ian Index: include/httpd.h =================================================================== RCS file: /home/cvspublic/httpd-2.0/include/httpd.h,v retrieving revision 1.168 diff -u -r1.168 httpd.h --- include/httpd.h 2001/10/23 17:26:57 1.168 +++ include/httpd.h 2001/11/08 22:36:37 @@ -1033,6 +1033,8 @@ server_addr_rec *addrs; /** Timeout, in seconds, before we give up */ int timeout; + /** Timeout, in seconds, before we give up on reading a request */ + int read_request_timeout; /** Seconds we'll wait for another request */ int keep_alive_timeout; /** Maximum requests per connection */ Index: server/config.c =================================================================== RCS file: /home/cvspublic/httpd-2.0/server/config.c,v retrieving revision 1.136 diff -u -r1.136 config.c --- server/config.c 2001/10/07 04:54:53 1.136 +++ server/config.c 2001/11/08 22:36:39 @@ -1558,6 +1558,7 @@ s->server_hostname = NULL; s->error_fname = NULL; s->timeout = 0; + s->read_request_timeout = 0; s->keep_alive_timeout = 0; s->keep_alive = -1; s->keep_alive_max = -1; @@ -1601,6 +1602,9 @@ if (virt->timeout == 0) virt->timeout = main_server->timeout; + + if (virt->read_request_timeout == 0) + virt->read_request_timeout = main_server->read_request_timeout; if (virt->keep_alive_timeout == 0) virt->keep_alive_timeout = main_server->keep_alive_timeout; @@ -1645,6 +1649,7 @@ s->limit_req_fieldsize = DEFAULT_LIMIT_REQUEST_FIELDSIZE; s->limit_req_fields = DEFAULT_LIMIT_REQUEST_FIELDS; s->timeout = DEFAULT_TIMEOUT; + s->read_request_timeout = DEFAULT_TIMEOUT; s->keep_alive_timeout = DEFAULT_KEEPALIVE_TIMEOUT; s->keep_alive_max = DEFAULT_KEEPALIVE; s->keep_alive = 1; Index: server/core.c =================================================================== RCS file: /home/cvspublic/httpd-2.0/server/core.c,v retrieving revision 1.88 diff -u -r1.88 core.c --- server/core.c 2001/11/08 14:29:36 1.88 +++ server/core.c 2001/11/08 22:36:43 @@ -1712,6 +1712,17 @@ return NULL; } +static const char *set_read_request_timeout(cmd_parms *cmd, void *dummy, const char +*arg) +{ + const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); + if (err != NULL) { + return err; + } + + cmd->server->read_request_timeout = atoi(arg); + return NULL; +} + static const char *set_idcheck(cmd_parms *cmd, void *d_, int arg) { core_dir_config *d=d_; @@ -2577,6 +2588,8 @@ AP_INIT_TAKE1("AcceptMutex", ap_mpm_set_accept_lock_mech, NULL, RSRC_CONF, \ "The system mutex implementation to use for the accept mutex"), #endif +AP_INIT_TAKE1("ReadRequestTimeout", set_read_request_timeout, NULL, RSRC_CONF, + "Read request timeout duration (sec)"), { NULL } }; Index: server/protocol.c =================================================================== RCS file: /home/cvspublic/httpd-2.0/server/protocol.c,v retrieving revision 1.51 diff -u -r1.51 protocol.c --- server/protocol.c 2001/11/07 05:41:22 1.51 +++ server/protocol.c 2001/11/08 22:36:44 @@ -585,8 +585,8 @@ apr_setsocketopt(conn->client_socket, APR_SO_TIMEOUT, (int)(keptalive ? r->server->keep_alive_timeout * APR_USEC_PER_SEC - : r->server->timeout * APR_USEC_PER_SEC)); - + : r->server->read_request_timeout * APR_USEC_PER_SEC)); + /* Get the request... */ if (!read_request_line(r)) { if (r->status == HTTP_REQUEST_URI_TOO_LARGE) { --OXfL5xGRrasGEqWY--