]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: h1-htx: Don't set HTX_FL_EOM flag on 1xx informational messages
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 21 Oct 2025 12:22:25 +0000 (14:22 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 21 Oct 2025 12:22:26 +0000 (14:22 +0200)
1xx informational messages are part of the HTTP response. It is not expected
to have a HX_FL_EOM flag set after parsing such messages when received from
a server. It is espacially important whne an informational messages is
processed on client side while the final response was not recieved yet, to
not erroneously detect the end of the message.

The HTTP multiplexers seem to ignore the HTX_FL_EOM flag for information
messages, but it remains an error from the HTX specification point of
view. So it must be fixed.

While it should theorically be backported as far as 3.0, it is a good idea
to not do so for now because no bug was reported and regressions may happen.

src/h1_htx.c

index 8c8723dad5a83777aa23c78af529fc962fa636b5..1e67b63c396e58fc8aac9a10c4c72bbcba601c91 100644 (file)
@@ -322,10 +322,11 @@ static int h1_postparse_res_hdrs(struct h1m *h1m, union h1_sl *h1sl, struct htx
 
                h1m->flags |= H1_MF_XFER_LEN;
                h1m->curr_len = h1m->body_len = 0;
-               if (code >= 200)
+               if (code >= 200) {
                        flags |= HTX_SL_F_BODYLESS_RESP;
+                       htx->flags |= HTX_FL_EOM;
+               }
                h1m->state = H1_MSG_DONE;
-               htx->flags |= HTX_FL_EOM;
        }
        else {
                if (h1m->flags & (H1_MF_CLEN|H1_MF_CHNK)) {