[MINOR] http: take http request timeout from the backend

Since we can now switch from TCP to HTTP, we need to be able to apply
the HTTP request timeout after switching. That means we need to take
it from the backend and not from the frontend. Since the backend points
to the frontend before switching, that changes nothing for the normal
case.
This commit is contained in:
Willy Tarreau 2009-07-12 10:03:17 +02:00
parent d88bb6f819
commit cd7afc0a13
4 changed files with 9 additions and 6 deletions

View File

@ -757,7 +757,7 @@ timeout client X X X -
timeout clitimeout X X X - (deprecated)
timeout connect X - X X
timeout contimeout X - X X (deprecated)
timeout http-request X X X -
timeout http-request X X X X
timeout queue X - X X
timeout server X - X X
timeout srvtimeout X - X X (deprecated)
@ -4107,7 +4107,7 @@ timeout contimeout <timeout> (deprecated)
timeout http-request <timeout>
Set the maximum allowed time to wait for a complete HTTP request
May be used in sections : defaults | frontend | listen | backend
yes | yes | yes | no
yes | yes | yes | yes
Arguments :
<timeout> is the timeout value specified in milliseconds by default, but
can be in any other unit if the number is suffixed by the unit,
@ -4133,7 +4133,9 @@ timeout http-request <timeout>
will prevent people from sending bare HTTP requests using telnet.
If this parameter is not set, the client timeout still applies between each
chunk of the incoming request.
chunk of the incoming request. It should be set in the frontend to take
effect, unless the frontend is in TCP mode, in which case the HTTP backend's
timeout will be used.
See also : "timeout client".

View File

@ -865,6 +865,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
curproxy->timeout.check = defproxy.timeout.check;
curproxy->timeout.queue = defproxy.timeout.queue;
curproxy->timeout.tarpit = defproxy.timeout.tarpit;
curproxy->timeout.httpreq = defproxy.timeout.httpreq;
curproxy->source_addr = defproxy.source_addr;
}

View File

@ -1688,7 +1688,7 @@ int http_wait_for_request(struct session *s, struct buffer *req, int an_bit)
/* just set the request timeout once at the beginning of the request */
if (!tick_isset(req->analyse_exp))
req->analyse_exp = tick_add_ifset(now_ms, s->fe->timeout.httpreq);
req->analyse_exp = tick_add_ifset(now_ms, s->be->timeout.httpreq);
/* we're not ready yet */
return 0;
@ -2535,7 +2535,7 @@ int http_process_request_body(struct session *s, struct buffer *req, int an_bit)
*/
buffer_write_dis(req);
if (!tick_isset(req->analyse_exp))
req->analyse_exp = tick_add_ifset(now_ms, s->fe->timeout.httpreq);
req->analyse_exp = tick_add_ifset(now_ms, s->be->timeout.httpreq);
return 0;
}
}

View File

@ -113,7 +113,7 @@ static int proxy_parse_timeout(char **args, int section, struct proxy *proxy,
} else if (!strcmp(args[0], "http-request")) {
tv = &proxy->timeout.httpreq;
td = &defpx->timeout.httpreq;
cap = PR_CAP_FE;
cap = PR_CAP_FE | PR_CAP_BE;
} else if (!strcmp(args[0], "server") || !strcmp(args[0], "srvtimeout")) {
name = "server";
tv = &proxy->timeout.server;