]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: proto-htx: Use channel_htx_fwd_headers() to forward 1xx responses
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 23 May 2019 08:33:12 +0000 (10:33 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 28 May 2019 05:42:33 +0000 (07:42 +0200)
Instead of doing it by hand, we now call the dedicated function to do so.

src/proto_htx.c

index 953b49f98d05a01d60e56d0c5c25c05867bddd32..dc0762d73f96a06e280d56c6878514137e617a59 100644 (file)
@@ -1695,19 +1695,8 @@ int htx_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
         */
        if (txn->status < 200 &&
            (txn->status == 100 || txn->status >= 102)) {
-               int32_t pos;
-
                FLT_STRM_CB(s, flt_http_reset(s, msg));
-               for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) {
-                       struct htx_blk *blk = htx_get_blk(htx, pos);
-                       enum htx_blk_type type = htx_get_blk_type(blk);
-
-                       c_adv(rep, htx_get_blksz(blk));
-                       if (type == HTX_BLK_EOH) {
-                               htx->sl_pos = htx_get_next(htx, pos);
-                               break;
-                       }
-               }
+               channel_htx_fwd_headers(rep, htx);
                msg->msg_state = HTTP_MSG_RPBEFORE;
                txn->status = 0;
                s->logs.t_data = -1; /* was not a response yet */