From b824b002cd55e3616e1c721e73b981a80444d0a9 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 29 Sep 2010 16:36:16 +0200 Subject: [PATCH] [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. --- doc/configuration.txt | 4 +++- src/proto_tcp.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/configuration.txt b/doc/configuration.txt index 926ce9a21..9eedf7987 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -5497,7 +5497,9 @@ tcp-request inspect-delay 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". diff --git a/src/proto_tcp.c b/src/proto_tcp.c index 267066612..22179b9ab 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -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;