]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: proto_htx: Truncate the request when an error is detected
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 4 Dec 2018 15:23:54 +0000 (16:23 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 4 Dec 2018 15:43:30 +0000 (16:43 +0100)
When HTTP_MSGF_ERROR is set on a channel (the request or the response), the
request must be truncated, not the response.

src/proto_htx.c

index b6c127ef876c09b073199e29761fd1ed19132cd0..e76d0bffc01a89eed41d8477ab04851b72a5473a 100644 (file)
@@ -5220,7 +5220,7 @@ static void htx_end_response(struct stream *s)
 
        if (unlikely(txn->req.msg_state == HTTP_MSG_ERROR ||
                     txn->rsp.msg_state == HTTP_MSG_ERROR)) {
-               channel_truncate(chn);
+               channel_truncate(&s->req);
                channel_abort(&s->req);
                goto end;
        }
@@ -5292,7 +5292,7 @@ static void htx_end_response(struct stream *s)
        if (txn->rsp.msg_state == HTTP_MSG_CLOSED) {
          http_msg_closed:
                /* drop any pending data */
-               channel_truncate(chn);
+               channel_truncate(&s->req);
                channel_abort(&s->req);
                goto end;
        }