- Fix fastopen EPIPE fallthrough to perform connect.

git-svn-id: file:///svn/unbound/trunk@4203 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2017-06-01 09:06:14 +00:00
parent 69828ed94b
commit 401e456a17
2 changed files with 23 additions and 1 deletions

View file

@ -1,3 +1,6 @@
1 June 2017: Wouter
- Fix fastopen EPIPE fallthrough to perform connect.
31 May 2017: Ralph
- Also use global local-zones when there is a matching view that does
not have any local-zone specified.

View file

@ -1415,7 +1415,26 @@ comm_point_tcp_handle_write(int fd, struct comm_point* c)
return 0;
}
/* fallthrough to nonFASTOPEN
* (MSG_FASTOPEN on Linux 3 produces EPIPE) */
* (MSG_FASTOPEN on Linux 3 produces EPIPE)
* we need to perform connect() */
if(connect(fd, &c->repinfo.addr, c->repinfo.addrlen) == -1) {
#ifdef EINPROGRESS
if(errno == EINPROGRESS)
return 1; /* wait until connect done*/
#endif
#ifdef USE_WINSOCK
if(WSAGetLastError() == WSAEINPROGRESS ||
WSAGetLastError() == WSAEWOULDBLOCK)
return 1; /* wait until connect done*/
#endif
if(tcp_connect_errno_needs_log(
&c->repinfo.addr, c->repinfo.addrlen)) {
log_err_addr("outgoing tcp: connect after EPIPE for fastopen",
strerror(errno), &c->repinfo.addr, c->repinfo.addrlen);
}
return 0;
}
} else {
c->tcp_byte_count += r;
if(c->tcp_byte_count < sizeof(uint16_t))