[MEDIUM] tcp-request : don't wait for inspect-delay to expire when the buffer is...
authorWilly Tarreau <w@1wt.eu>
Wed, 29 Sep 2010 14:36:16 +0000 (16:36 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 30 Oct 2010 17:04:31 +0000 (19:04 +0200)
If a request buffer is full, there's no point waiting for the timeout to
expire, the contents will not change.

doc/configuration.txt
src/proto_tcp.c

index 926ce9a..9eedf79 100644 (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".
index 2670666..22179b9 100644 (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;