]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: htx: Stop a header or a start line lookup on the first EOH or EOM
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 28 Nov 2018 15:55:12 +0000 (16:55 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 1 Dec 2018 16:20:36 +0000 (17:20 +0100)
Because several messages can be stored in the HTX structure, it is important to
restrict searches to the current message.

src/http_htx.c

index 129523178031bc7255954edac29ee579f51781ac..c3027f948498d524bcfdbed64a8e289ff719ce8b 100644 (file)
@@ -47,7 +47,8 @@ union h1_sl http_find_stline(const struct htx *htx)
                        sl.st.r = ist2(htx_sl->st.l + htx_sl->st.v_len + htx_sl->st.c_len, htx_sl->st.r_len);
                        return sl;
                }
-               if (type == HTX_BLK_EOM)
+
+               if (type == HTX_BLK_EOH || type == HTX_BLK_EOM)
                        break;
        }
 
@@ -107,6 +108,8 @@ int http_find_header(const struct htx *htx, const struct ist name,
          rescan_hdr:
                blk  = htx_get_blk(htx, pos);
                type = htx_get_blk_type(blk);
+               if (type == HTX_BLK_EOH || type == HTX_BLK_EOM)
+                       break;
                if (type != HTX_BLK_HDR)
                        goto next_blk;
                if (name.len) {