]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: http-ana: Don't wait for the body of CONNECT requests
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 16 Nov 2020 15:03:35 +0000 (16:03 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 17 Nov 2020 09:03:12 +0000 (10:03 +0100)
CONNECT requests are bodyless messages but with no EOM blocks. Thus, conditions
to stop waiting for the message payload are not suited to this kind of
messages. Indeed, the message finishes on an EOH block. But the tunnel mode at
the stream level is only set in HTTP_XFER_BODY analyser. So, the stream is
blocked, waiting for a body that does not exist till a timeout expires.

To fix this bug, we just stop waiting for a body for CONNECT requests. Another
solution is to rely on HTX_SL_F_BODYLESS/HTTP_MSGF_BODYLESS flags. But this one
is less intrusive.

This message must be backported as far as 2.0. For the 2.0, only the HTX part
must be fixed.

src/http_ana.c

index 4963b8f2f9f200a2c2eb8b081a653c3fc010d751..9e170828822eb9614f98a7f57e7b4e8982364692 100644 (file)
@@ -1044,6 +1044,10 @@ int http_wait_for_request_body(struct stream *s, struct channel *req, int an_bit
        if (htx->flags & HTX_FL_PROCESSING_ERROR)
                goto return_int_err;
 
+       /* CONNECT requests have no body */
+       if (txn->meth == HTTP_METH_CONNECT)
+               goto http_end;
+
        if (msg->msg_state < HTTP_MSG_BODY)
                goto missing_data;