Mercurial > dropbear
comparison netio.c @ 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 |
comparison
equal
deleted
inserted
replaced
1035:8ed1d37e75a6 | 1047:e6c4cd0510d9 |
---|---|
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 && errno == EOPNOTSUPP) { | 106 if (res < 0) { |
107 TRACE(("Fastopen not supported")); | 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 */ | |
109 TRACE(("sendmsg tcp_fastopen failed, falling back. %s", strerror(errno))); | |
108 /* No kernel MSG_FASTOPEN support. Fall back below */ | 110 /* No kernel MSG_FASTOPEN support. Fall back below */ |
109 fastopen = 0; | 111 fastopen = 0; |
110 /* Set to NULL to avoid trying again */ | 112 /* Set to NULL to avoid trying again */ |
111 c->writequeue = NULL; | 113 c->writequeue = NULL; |
112 } | 114 } |