mirror of https://github.com/getdnsapi/getdns.git
Initial TCP support for Windows
This commit is contained in:
parent
61c0a51ec5
commit
fed8cc51ed
12
src/stub.c
12
src/stub.c
|
@ -390,12 +390,16 @@ tcp_connect(getdns_upstream *upstream, getdns_transport_list_t transport)
|
||||||
}
|
}
|
||||||
return fd;
|
return fd;
|
||||||
#endif
|
#endif
|
||||||
|
printf("fd: %d\n",fd);
|
||||||
if (connect(fd, (struct sockaddr *)&upstream->addr,
|
if (connect(fd, (struct sockaddr *)&upstream->addr,
|
||||||
upstream->addr_len) == -1) {
|
upstream->addr_len) == -1) {
|
||||||
if (errno != EINPROGRESS) {
|
#if USE_WINSOCK
|
||||||
close(fd);
|
printf("WSAGetLastError(): %d\n", WSAGetLastError());
|
||||||
return -1;
|
#endif
|
||||||
}
|
if (_getdns_EINPROGRESS || _getdns_EWOULDBLOCK)
|
||||||
|
return fd;
|
||||||
|
close(fd);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue