From 33b2db69a95e224bc4360020ed0215c3e04cb020 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 29 Dec 2009 08:02:56 +0100 Subject: [PATCH] [MINOR] stream_sock: prepare for closing when all pending data are sent Since we'll soon be able to close a connection with remaining data in a buffer, it becomes obvious that we can prepare to close when we're about to send the last chunk of data and not the whole buffer. --- src/stream_sock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stream_sock.c b/src/stream_sock.c index a733e9939..89102adc0 100644 --- a/src/stream_sock.c +++ b/src/stream_sock.c @@ -612,7 +612,7 @@ static int stream_sock_write_loop(struct stream_interface *si, struct buffer *b) if (MSG_MORE && (((b->flags & (BF_SHUTW|BF_SHUTW_NOW|BF_HIJACK)) == BF_SHUTW_NOW && - (max == b->l)) || + (max == b->send_max)) || (max != b->l && max != b->send_max)) && (fdtab[si->fd].flags & FD_FL_TCP)) { send_flag |= MSG_MORE;