mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 05:41:26 +02:00
In 1.8 when muxes and conn_streams were introduced, the call to conn_full_close() was replaced with a call to cs_close() which only relied on shutr/shutw (commits 6978db35e ("MINOR: connection: add cs_close() to close a conn_stream") and a553ae96f ("MEDIUM: connection: replace conn_full_close() with cs_close()")). By then this was fine, and the rare risk of non-idempotent calls was addressed by the muxes implementing the functions (e.g. mux_pt). Later with commit 325607397 ("MEDIUM: stream: do not forcefully close the client connection anymore"), stream_free() started to call cs_close() instead of forcibly closing the connection via conn_full_close(). At this point this started to break idempotence because it was possible to emit a shutw() (e.g. when option httpclose was set), then to have it called agian upon stream_free() via cs_close(). By then it was not a problem since only mux_pt would implement this and did check for idempotence. When HTX was implemented and mux-h1/h2 offered support for shutw/shutr, the idempotence changed a little bit because the last shutdown mode (normal/silent) was recorded and used at the moment of closing. The call to cs_close() uses the silent mode and will replace the current one. This has an effect on data pending in the buffer if the FIN could not be sent before cs_close(), because lingering may be disabled and final data lost in the network stack. Interestingly, during 2.4-dev3, this was addressed as the side effect of an improvement by commit 3c82d8b32 ("MINOR: mux-h1: Rework how shutdowns are handled"), where the H1 mux's shutdown function becomes explicitly idempotent. However older versions (2.3 to 2.0) do not have it. This patch addresses the issue globally by making sure that cs_shutr() and cs_shutw() are idempotent and cannot have their data truncated by a late cs_close(). It fixes the truncation that is observed in 2.3 and 2.2 as described in issue #1450. This must be backported as far as 2.0, along with commit f14d750bf ("BUG/MEDIUM: conn-stream: Don't reset CS flags on close") which it depends on.
The HAProxy documentation has been split into a number of different files for ease of use. Please refer to the following files depending on what you're looking for : - INSTALL for instructions on how to build and install HAProxy - BRANCHES to understand the project's life cycle and what version to use - LICENSE for the project's license - CONTRIBUTING for the process to follow to submit contributions The more detailed documentation is located into the doc/ directory : - doc/intro.txt for a quick introduction on HAProxy - doc/configuration.txt for the configuration's reference manual - doc/lua.txt for the Lua's reference manual - doc/SPOE.txt for how to use the SPOE engine - doc/network-namespaces.txt for how to use network namespaces under Linux - doc/management.txt for the management guide - doc/regression-testing.txt for how to use the regression testing suite - doc/peers.txt for the peers protocol reference - doc/coding-style.txt for how to adopt HAProxy's coding style - doc/internals for developer-specific documentation (not all up to date)
Description
Languages
C
98.1%
Shell
0.8%
Makefile
0.5%
Lua
0.2%
Python
0.2%