Winsock connect returns WSAEWOULDBLOCK...
...instead of EINPROGRESS. And we get to call WSAGetLasteError() too boot :(
This commit is contained in:
@@ -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;
|
||||
|
@@ -1175,6 +1175,9 @@ int ROKEN_LIB_FUNCTION rk_socket(int, int, int);
|
||||
#ifndef EAFNOSUPPORT
|
||||
#define EAFNOSUPPORT 102
|
||||
#endif
|
||||
#ifndef EINPROGRESS
|
||||
#define EINPROGRESS 112
|
||||
#endif
|
||||
#ifndef ENOTSOCK
|
||||
#define ENOTSOCK 128
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user