]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] stream_sock: prepare for closing when all pending data are sent
authorWilly Tarreau <w@1wt.eu>
Tue, 29 Dec 2009 07:02:56 +0000 (08:02 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 29 Dec 2009 07:02:56 +0000 (08:02 +0100)
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

index a733e9939ca9b24df3c560861754fa796127411d..89102adc060be87c3e22108897a38da69fd64b48 100644 (file)
@@ -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;