changeset 1047:e6c4cd0510d9 fastopen

ignore any sendmsg() errors
author Matt Johnston <matt@ucc.asn.au>
date Thu, 26 Feb 2015 23:43:12 +0800
parents 8ed1d37e75a6
children 9cec9ed503bb
files netio.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/netio.c	Sat Feb 21 00:43:32 2015 +0800
+++ b/netio.c	Thu Feb 26 23:43:12 2015 +0800
@@ -103,8 +103,10 @@
 			message.msg_iov = packet_queue_to_iovec(c->writequeue, &iovlen);
 			message.msg_iovlen = iovlen;
 			res = sendmsg(c->sock, &message, MSG_FASTOPEN);
-			if (res < 0 && errno == EOPNOTSUPP) {
-				TRACE(("Fastopen not supported"));
+			if (res < 0) {
+				/* 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)));
 				/* No kernel MSG_FASTOPEN support. Fall back below */
 				fastopen = 0;
 				/* Set to NULL to avoid trying again */