Winsock connect returns WSAEWOULDBLOCK...

...instead of EINPROGRESS.  And we get to call WSAGetLasteError() too boot :(
This commit is contained in:
Nicolas Williams
2013-03-18 23:15:29 -05:00
parent b1e4766753
commit f490acc526
2 changed files with 7 additions and 0 deletions

View File

@@ -484,6 +484,10 @@ host_connect(krb5_context context, krb5_sendto_ctx ctx, struct host *host)
debug_host(context, 5, host, "connecting to host");
if (connect(host->fd, ai->ai_addr, ai->ai_addrlen) < 0) {
#ifdef HAVE_WINSOCK
if (WSAGetLastError() == WSAEWOULDBLOCK)
errno = EINPROGRESS;
#endif /* HAVE_WINSOCK */
if (errno == EINPROGRESS && (hi->proto == KRB5_KRBHST_HTTP || hi->proto == KRB5_KRBHST_TCP)) {
debug_host(context, 5, host, "connecting to %d", host->fd);
host->state = CONNECTING;