]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: tarpit: fix condition to return the HTTP 500 message
authorWilly Tarreau <w@1wt.eu>
Mon, 23 Jul 2012 08:55:43 +0000 (10:55 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 Jul 2012 05:55:31 +0000 (07:55 +0200)
Commit fa7e1025 (1.3.16-rc1) introduced a minor bug by comparing req->flags
with BF_READ_ERROR instead of checking for the bit. The result is that the
error message is always returned even in case of client error. This has no
real impact but this must be fixed.

It may be backported to 1.4 and 1.3.

src/proto_http.c

index 820f6434f2dc858b5e2fa57cdfdc596b46796c2b..7e1d738d87163913432b69776a86246821f2d014 100644 (file)
@@ -3540,7 +3540,7 @@ int http_process_tarpit(struct session *s, struct buffer *req, int an_bit)
        s->logs.t_queue = tv_ms_elapsed(&s->logs.tv_accept, &now);
 
        txn->status = 500;
-       if (req->flags != BF_READ_ERROR)
+       if (!(req->flags & BF_READ_ERROR))
                stream_int_retnclose(req->prod, error_message(s, HTTP_ERR_500));
 
        req->analysers = 0;