]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: proto_htx: Reset to_forward value when a message is set to DONE
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 28 Mar 2019 17:12:46 +0000 (18:12 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 1 Apr 2019 13:43:40 +0000 (15:43 +0200)
Because we try to forward infinitly message body, when its state is set to DONE,
we must be sure to reset to_foward value of the corresponding
channel. Otherwise, some errors can be errornously triggered.

No need to backport this patch.

src/proto_htx.c

index 23a6faea2926d6dddac4c42774282ee5e9ab743b..e27f24e1bdb3098c556edf504b0e5ae5f058fe7b 100644 (file)
@@ -1253,6 +1253,7 @@ int htx_request_forward_body(struct stream *s, struct channel *req, int an_bit)
                goto missing_data_or_waiting;
 
        msg->msg_state = HTTP_MSG_DONE;
+       req->to_forward = 0;
 
   done:
        /* other states, DONE...TUNNEL */
@@ -2183,6 +2184,7 @@ int htx_response_forward_body(struct stream *s, struct channel *res, int an_bit)
                goto missing_data_or_waiting;
 
        msg->msg_state = HTTP_MSG_DONE;
+       res->to_forward = 0;
 
   done:
        /* other states, DONE...TUNNEL */