]> 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 18:24:27 +0000 (20:24 +0200)
commit77cb0671427453e3bc18ed2232fd7f5da94b6482
treecfdbcef87bdb06bf5e1088455cf24b7006e8b9c5
parentb6b8f478e2a54a5c99f7d034fd7bc24925cf5309
[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.
(cherry picked from commit 720058cdcbd5285dc4e4a48216b10c9b96000141)
src/stream_sock.c