From: Willy Tarreau Date: Mon, 30 May 2011 15:32:53 +0000 (+0200) Subject: [CLEANUP] stream_sock: remove unneeded FL_TCP and factor out test X-Git-Tag: v1.5-dev8~230 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8ca19bcd99fe3b915007763df7b45045157471c;p=thirdparty%2Fhaproxy.git [CLEANUP] stream_sock: remove unneeded FL_TCP and factor out test The FL_TCP flag was a leftover from the old days we were using TCP_CORK. With MSG_MORE it's not needed anymore so we can remove the condition and sensibly simplify the test. --- diff --git a/src/stream_sock.c b/src/stream_sock.c index 0d55128a80..3641b4e45f 100644 --- a/src/stream_sock.c +++ b/src/stream_sock.c @@ -643,13 +643,10 @@ static int stream_sock_write_loop(struct stream_interface *si, struct buffer *b) if (MSG_NOSIGNAL && MSG_MORE) { unsigned int send_flag = MSG_DONTWAIT | MSG_NOSIGNAL; - if (((b->to_forward && b->to_forward != BUF_INFINITE_FORWARD) || - ((b->flags & (BF_SHUTW|BF_SHUTW_NOW|BF_HIJACK)) == BF_SHUTW_NOW && (max == b->send_max)) || - (max != b->l && max != b->send_max)) - && (fdtab[si->fd].flags & FD_FL_TCP)) { - send_flag |= MSG_MORE; - } - else if (b->flags & BF_EXPECT_MORE) { + if ((b->to_forward && b->to_forward != BUF_INFINITE_FORWARD) || + (b->flags & BF_EXPECT_MORE) || + ((b->flags & (BF_SHUTW|BF_SHUTW_NOW|BF_HIJACK)) == BF_SHUTW_NOW && (max == b->send_max)) || + (max != b->l && max != b->send_max)) { send_flag |= MSG_MORE; }