mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 22:31:28 +02:00
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!
This commit is contained in:
parent
88c6d81386
commit
f9fbfe8229
@ -1165,8 +1165,20 @@ void stream_sock_read0(struct stream_interface *si)
|
||||
return;
|
||||
|
||||
do_close:
|
||||
/* OK we completely close the socket here just as if we went through si_shut[rw]() */
|
||||
conn_xprt_close(si->conn);
|
||||
fd_delete(si->conn->t.sock.fd);
|
||||
|
||||
si->ib->flags &= ~CF_SHUTR_NOW;
|
||||
si->ib->flags |= CF_SHUTR;
|
||||
si->ib->rex = TICK_ETERNITY;
|
||||
|
||||
si->ob->flags &= ~CF_SHUTW_NOW;
|
||||
si->ob->flags |= CF_SHUTW;
|
||||
si->ob->wex = TICK_ETERNITY;
|
||||
|
||||
si->flags &= ~(SI_FL_WAIT_DATA | SI_FL_WAIT_ROOM);
|
||||
|
||||
si->state = SI_ST_DIS;
|
||||
si->exp = TICK_ETERNITY;
|
||||
if (si->release)
|
||||
|
Loading…
x
Reference in New Issue
Block a user