mirror of https://github.com/getdnsapi/getdns.git
Fix issue on macOX 10.10 where TCP fast open is detected but not implemented causing TCP to fail. The fix allows fallback to regular TCP in this case and is also more robust for cases where connectx() fails for some reason.
This commit is contained in:
parent
665c3f6fb5
commit
33ff6a95ac
11
src/stub.c
11
src/stub.c
|
@ -427,13 +427,12 @@ tcp_connect(getdns_upstream *upstream, getdns_transport_list_t transport)
|
||||||
endpoints.sae_dstaddrlen = upstream->addr_len;
|
endpoints.sae_dstaddrlen = upstream->addr_len;
|
||||||
if (connectx(fd, &endpoints, SAE_ASSOCID_ANY,
|
if (connectx(fd, &endpoints, SAE_ASSOCID_ANY,
|
||||||
CONNECT_DATA_IDEMPOTENT | CONNECT_RESUME_ON_READ_WRITE,
|
CONNECT_DATA_IDEMPOTENT | CONNECT_RESUME_ON_READ_WRITE,
|
||||||
NULL, 0, NULL, NULL) == -1) {
|
NULL, 0, NULL, NULL) == 0) {
|
||||||
if (errno != EINPROGRESS) {
|
|
||||||
close(fd);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return fd;
|
return fd;
|
||||||
|
}
|
||||||
|
if (errno == EINPROGRESS) {
|
||||||
|
return fd;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
(void)transport;
|
(void)transport;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue