[MEDIUM] tcp-request : don't wait for inspect-delay to expire when the buffer is full

If a request buffer is full, there's no point waiting for the timeout to
expire, the contents will not change.
This commit is contained in:
Willy Tarreau 2010-09-29 16:36:16 +02:00
parent 22a9534213
commit b824b002cd
2 changed files with 4 additions and 2 deletions

View File

@ -5497,7 +5497,9 @@ tcp-request inspect-delay <timeout>
to use large values, for instance to ensure that the client never talks
before the server (eg: SMTP), or to wait for a client to talk before passing
data to the server (eg: SSL). Note that the client timeout must cover at
least the inspection delay, otherwise it will expire first.
least the inspection delay, otherwise it will expire first. If the client
closes the connection or if the buffer is full, the delay immediately expires
since the contents will not be able to change anymore.
See also : "tcp-request content accept", "tcp-request content reject",
"timeout client".

View File

@ -646,7 +646,7 @@ int tcp_inspect_request(struct session *s, struct buffer *req, int an_bit)
* - if one rule returns KO, then return KO
*/
if (req->flags & BF_SHUTR || !s->be->tcp_req.inspect_delay || tick_is_expired(req->analyse_exp, now_ms))
if (req->flags & (BF_SHUTR|BF_FULL) || !s->be->tcp_req.inspect_delay || tick_is_expired(req->analyse_exp, now_ms))
partial = 0;
else
partial = ACL_PARTIAL;