]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: proto_htx: Fix request/response synchronisation on error
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 19 Nov 2018 20:59:00 +0000 (21:59 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 20 Nov 2018 13:31:44 +0000 (14:31 +0100)
The HTTP transaction must be aborted if an error is detected on any one
side.

src/proto_htx.c

index c16fc1e29406e1af5d944f2351f433a3f527082d..20689727c5097cd2107bb6f9a673276692ca9687 100644 (file)
@@ -4946,7 +4946,8 @@ static void htx_end_request(struct stream *s)
                h1_msg_state_str(txn->req.msg_state), h1_msg_state_str(txn->rsp.msg_state),
                s->req.analysers, s->res.analysers);
 
-       if (unlikely(txn->req.msg_state == HTTP_MSG_ERROR)) {
+       if (unlikely(txn->req.msg_state == HTTP_MSG_ERROR ||
+                    txn->rsp.msg_state == HTTP_MSG_ERROR)) {
                channel_abort(chn);
                channel_truncate(chn);
                goto end;
@@ -5080,7 +5081,8 @@ static void htx_end_response(struct stream *s)
                h1_msg_state_str(txn->req.msg_state), h1_msg_state_str(txn->rsp.msg_state),
                s->req.analysers, s->res.analysers);
 
-       if (unlikely(txn->rsp.msg_state == HTTP_MSG_ERROR)) {
+       if (unlikely(txn->req.msg_state == HTTP_MSG_ERROR ||
+                    txn->rsp.msg_state == HTTP_MSG_ERROR)) {
                channel_truncate(chn);
                channel_abort(&s->req);
                goto end;