]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MAJOR: http: Fix possible infinity loop in http_sync_(req|res)_state
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 20 Jul 2017 09:05:10 +0000 (11:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 20 Jul 2017 09:44:28 +0000 (11:44 +0200)
In commit "MINOR: http: Switch requests/responses in TUNNEL mode only by
checking txn flags", it is possible to have an infinite loop on HTTP_MSG_CLOSING
state.

src/proto_http.c

index f9dc8a1b44488c9cb5479854359164c4e319cc81..e72e7e9620ed677f61cd1a252980d0b93e40b173 100644 (file)
@@ -5413,8 +5413,8 @@ int http_sync_req_state(struct stream *s)
                else if (chn->flags & CF_SHUTW) {
                        txn->req.err_state = txn->req.msg_state;
                        txn->req.msg_state = HTTP_MSG_ERROR;
-                       goto wait_other_side;
                }
+               goto wait_other_side;
        }
 
        if (txn->req.msg_state == HTTP_MSG_CLOSED) {
@@ -5542,8 +5542,8 @@ int http_sync_res_state(struct stream *s)
                        s->be->be_counters.cli_aborts++;
                        if (objt_server(s->target))
                                objt_server(s->target)->counters.cli_aborts++;
-                       goto wait_other_side;
                }
+               goto wait_other_side;
        }
 
        if (txn->rsp.msg_state == HTTP_MSG_CLOSED) {