]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[BUG] stream_sock: always shutdown(SHUT_WR) before closing
authorWilly Tarreau <w@1wt.eu>
Tue, 14 Jul 2009 17:21:50 +0000 (19:21 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 14 Jul 2009 17:21:50 +0000 (19:21 +0200)
commit720058cdcbd5285dc4e4a48216b10c9b96000141
tree777ac39b1067162bc4c0480997233529c1c0387b
parent1a211943f664ef0326da42f80c879ce87621c2e4
[BUG] stream_sock: always shutdown(SHUT_WR) before closing

When we close a socket with unread data in the buffer, or when the
nolinger option is set, we regularly lose the last fragment, which
often contains the error message. This typically occurs when sending
too large a request. Only the RST is seen due to the close() (since
not all data were read) and the output message never reaches the
network.

Doing a shutdown() before the close() solves this annoying issue
because the data are really pushed before the system sends the RST.
src/stream_sock.c