]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MAJOR: stream_interface: read0 not always handled since dev12
authorWilly Tarreau <w@1wt.eu>
Wed, 21 Nov 2012 20:51:53 +0000 (21:51 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 21 Nov 2012 20:59:51 +0000 (21:59 +0100)
commitf9fbfe82290da341dda215fba69b6ad003f50001
tree099c2428dd624fcfddd90ed4b995e2bb752cb9f2
parent88c6d81386d578e608bf1f9e2e3a0d3f7fec4c90
BUG/MAJOR: stream_interface: read0 not always handled since dev12

The connection handling changed introduced in 1.5-dev12 introduced a
regression with commit 9bf9c14c. The issue is that the stream_sock_read0()
callback must update the channel flags to indicate that the side is closed
so that when process_session() is called, it can propagate the close to the
other side and terminate the session.

The issue only appears in HTTP tunnel mode. It's a bit tricky to trigger
the issue, it requires that the request channel is full with data flowing
from the client to the server and that both the response and the read0()
are received at once so that the flags are not updated, and that the HTTP
analyser switches to tunnel mode without being informed that the request
write side is closed. After that, process_session() does not know that the
connection has to be aborted either, and no more event appears on this side
where the connection stays here forever.

Many thanks to Igor at owind for testing several snapshots and for providing
valuable traces to reproduce and diagnose the issue!
src/stream_interface.c