]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: h2: enable recv polling whenever demuxing is possible
authorWilly Tarreau <w@1wt.eu>
Sun, 10 Dec 2017 21:17:57 +0000 (22:17 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 10 Dec 2017 21:17:57 +0000 (22:17 +0100)
commit315d807cbc21ec329d547f6174d8e1136bf59187
tree184012d0837cf5c9b39b8c1586e77cac4426ec06
parentc9ede6c43e40b255d7caa22c41a6790314699dc1
BUG/MEDIUM: h2: enable recv polling whenever demuxing is possible

In order to allow demuxing when the dmux buffer is full, we need to
enable data receipt in multiple conditions. Since the conditions are a
bit complex, they have been delegated to a new function h2_recv_allowed()
which follows these rules :

  - if an error or a shutdown was detected on the connection and the buffer
    is empty, we must not attempt to receive
  - if the demux buf failed to be allocated, we must not try to receive and
    we know there is nothing pending
  - if the buffer is not full, we may attempt to receive
  - if no flag indicates a blocking condition, we may attempt to receive
  - otherwise must may not attempt

No more truncated payloads are detected in tests anymore, which seems to
indicate that the issue was worked around. A better connection API will
have to be created for new versions to make this stuff simpler and more
intuitive.

This fix needs to be backported to 1.8 along with the rest of the patches
related to CS_FL_RCV_MORE.
src/mux_h2.c