mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 05:41:26 +02:00
BUG/MEDIUM: stream_interface: don't close outgoing connections on shutw()
Commit 7bb68abb introduced the SI_FL_NOHALF flag in dev10. It is used to automatically close the write side of a connection whose read side is closed. But the patch also caused the opposite to happen, which is that a simple shutw() call would immediately close the connection. This is not desired because when using option abortonclose, we want to pass the client's shutdown to the server which will decide what to do with it. So let's avoid the close when SHUTR is not set.
This commit is contained in:
parent
a7a7ebc382
commit
9568d7108f
@ -297,7 +297,13 @@ int stream_int_shutw(struct stream_interface *si)
|
||||
if (conn->xprt && conn->xprt->shutw)
|
||||
conn->xprt->shutw(conn, 1);
|
||||
|
||||
if (!(si->flags & SI_FL_NOHALF)) {
|
||||
/* If the stream interface is configured to disable half-open
|
||||
* connections, we'll skip the shutdown(), but only if the
|
||||
* read size is already closed. Otherwise we can't support
|
||||
* closed write with pending read (eg: abortonclose while
|
||||
* waiting for the server).
|
||||
*/
|
||||
if (!(si->flags & SI_FL_NOHALF) || !(si->ib->flags & (CF_SHUTR|CF_DONT_READ))) {
|
||||
/* We shutdown transport layer */
|
||||
if (conn->ctrl)
|
||||
shutdown(si->conn->t.sock.fd, SHUT_WR);
|
||||
|
Loading…
x
Reference in New Issue
Block a user