changeset 1048:9cec9ed503bb fastopen

EINPROGRESS for sendmsg() means it's working OK
author Matt Johnston <matt@ucc.asn.au>
date Fri, 27 Feb 2015 00:02:48 +0800
parents e6c4cd0510d9
children 01eea88963f3
files netio.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/netio.c	Thu Feb 26 23:43:12 2015 +0800
+++ b/netio.c	Fri Feb 27 00:02:48 2015 +0800
@@ -103,7 +103,7 @@
 			message.msg_iov = packet_queue_to_iovec(c->writequeue, &iovlen);
 			message.msg_iovlen = iovlen;
 			res = sendmsg(c->sock, &message, MSG_FASTOPEN);
-			if (res < 0) {
+			if (res < 0 && errno != EINPROGRESS) {
 				/* Not entirely sure which kind of errors are normal - 2.6.32 seems to 
 				return EPIPE for any (nonblocking?) sendmsg(). just fall back */
 				TRACE(("sendmsg tcp_fastopen failed, falling back. %s", strerror(errno)));