]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: mux-h1: Report EOI instead EOS on parsing error or H2 upgrade
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 17 May 2019 07:14:10 +0000 (09:14 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 24 May 2019 07:11:01 +0000 (09:11 +0200)
commit8e9e3ef15c80557994ffecf89bed08a384b09c5b
treecc1f48ac8b4d3f8731853f3597d3af32c7572320
parent316934d3c905907e8dc8aadec3d1be237177bf7f
BUG/MINOR: mux-h1: Report EOI instead EOS on parsing error or H2 upgrade

When a parsing error occurrs in the H1 multiplexer, we stop to copy HTX
blocks. So the error may be reported with an emtpy HTX message. For instance, if
the headers parsing failed. When it happens, the flag CS_FL_EOS is also set on
the conn_stream. But it is an error. Most of time, it is set on established
connections, so it is not really an issue. But if it happens when the server
connection is not fully established, the connection is shut down immediatly and
the stream-interface is switched from SI_ST_CON to SI_ST_DIS/CLO. So HTX
analyzers have no chance to catch the error.

Instead of setting CS_FL_EOS, it is fairly better to set CS_FL_EOI, which is the
right flag to use. The same is also done on H2 upgrade. As a side effet of this
fix, in the stream-interface code, we must now set the flag CF_READ_PARTIAL on
the channel when the flag CF_EOI is set. It is a warranty to wakeup the stream
when EOI is reported to the channel while no data are received.

This patch must be backported to 1.9.
src/mux_h1.c
src/stream_interface.c