comparison netio.c @ 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 c2a50c9f509e
comparison
equal deleted inserted replaced
1047:e6c4cd0510d9 1048:9cec9ed503bb
101 if (c->writequeue) { 101 if (c->writequeue) {
102 int iovlen; /* Linux msg_iovlen is a size_t */ 102 int iovlen; /* Linux msg_iovlen is a size_t */
103 message.msg_iov = packet_queue_to_iovec(c->writequeue, &iovlen); 103 message.msg_iov = packet_queue_to_iovec(c->writequeue, &iovlen);
104 message.msg_iovlen = iovlen; 104 message.msg_iovlen = iovlen;
105 res = sendmsg(c->sock, &message, MSG_FASTOPEN); 105 res = sendmsg(c->sock, &message, MSG_FASTOPEN);
106 if (res < 0) { 106 if (res < 0 && errno != EINPROGRESS) {
107 /* Not entirely sure which kind of errors are normal - 2.6.32 seems to 107 /* Not entirely sure which kind of errors are normal - 2.6.32 seems to
108 return EPIPE for any (nonblocking?) sendmsg(). just fall back */ 108 return EPIPE for any (nonblocking?) sendmsg(). just fall back */
109 TRACE(("sendmsg tcp_fastopen failed, falling back. %s", strerror(errno))); 109 TRACE(("sendmsg tcp_fastopen failed, falling back. %s", strerror(errno)));
110 /* No kernel MSG_FASTOPEN support. Fall back below */ 110 /* No kernel MSG_FASTOPEN support. Fall back below */
111 fastopen = 0; 111 fastopen = 0;