mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-24 23:31:40 +02:00
It is the second part and the most important of the fix. Since the mux-h1 refactoring, and more specifically since the commit c4bfa59f1 ("MAJOR: mux-h1: Create the client stream as later as possible"), the upgrade from a TCP client connection to H1 is broken. Indeed, now the H1 mux is responsible to create the frontend conn-stream once the request headers are fully received. But, to properly support TCP to H1 upgrades, we must inherit from the existing conn-stream. To do so, if the conn-stream already exists when the client H1 connection is created, we create a H1 stream in ST_ATTACHED state, but not ST_READY, and the conn-stream is attached to it. Because the ST_READY state is not set, no data are xferred to the data layer when h1_rcv_buf() is called and shutdowns are inhibited except on client aborts. This way, the request is parsed the same way than for a classical H1 connection. Once the request headers are fully received and parsed, the data stream is upgraded and the ST_READY state is set. A tricky case appears when an H2 upgrade is performed because the H2 preface is matched. In this case, the conn-stream must be detached and destroyed before switching to the H2 mux and releasing the current H1 mux. We must also take care to detach and destroy the conn-stream when a timeout occurres. This patch relies on the following series of patches : * BUG/MEDIUM: stream: Don't immediatly ack the TCP to H1 upgrades * MEDIUM: http-ana: Do nothing in wait-for-request analyzer if not htx * MINOR: stream: Add a function to validate TCP to H1 upgrades * MEDIUM: mux-h1: Add ST_READY state for the H1 connections * MINOR: mux-h1: Wake up instead of subscribe for reads after H1C creation * MINOR: mux-h1: Try to wake up data layer first before calling its wake callback * MINOR: stream-int: Take care of EOS in the SI wake callback function * BUG/MINOR: stream: Don't update counters when TCP to H2 upgrades are performed This fix is specific for 2.4. No backport needed.
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%