Add drain_and_close_socket()
authorFabian Keil <fk@fabiankeil.de>
Fri, 12 Oct 2012 11:17:48 +0000 (11:17 +0000)
committerFabian Keil <fk@fabiankeil.de>
Fri, 12 Oct 2012 11:17:48 +0000 (11:17 +0000)
commitc076ee3df798ec00e61c1708d0b1e352971ee41c
treee43f3f3faaf3fbd747dd77850c60d8de9ee8faff
parent588d5d7c613c800728d4a6fd40f886c7f7388bf2
Add drain_and_close_socket()

Apparently on some platforms immediately closing a client socket
with both unread and written-but-not-yet-transmitted data may result
in the connection being teared down prematurely, in which case
the client ends up with an incomplete response.

To prevent this, drain_and_close_socket() shuts down our side of
the connection (on platforms with shutdown()), drains the unread
data on the socket and finally calls close_socket().

I suspect that this was the main cause of the page truncation
issues reported with Opera in #3464439.
configure.in
jbsockets.c
jbsockets.h