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");
|
debug_host(context, 5, host, "connecting to host");
|
||||||
|
|
||||||
if (connect(host->fd, ai->ai_addr, ai->ai_addrlen) < 0) {
|
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)) {
|
if (errno == EINPROGRESS && (hi->proto == KRB5_KRBHST_HTTP || hi->proto == KRB5_KRBHST_TCP)) {
|
||||||
debug_host(context, 5, host, "connecting to %d", host->fd);
|
debug_host(context, 5, host, "connecting to %d", host->fd);
|
||||||
host->state = CONNECTING;
|
host->state = CONNECTING;
|
||||||
|
@@ -1175,6 +1175,9 @@ int ROKEN_LIB_FUNCTION rk_socket(int, int, int);
|
|||||||
#ifndef EAFNOSUPPORT
|
#ifndef EAFNOSUPPORT
|
||||||
#define EAFNOSUPPORT 102
|
#define EAFNOSUPPORT 102
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef EINPROGRESS
|
||||||
|
#define EINPROGRESS 112
|
||||||
|
#endif
|
||||||
#ifndef ENOTSOCK
|
#ifndef ENOTSOCK
|
||||||
#define ENOTSOCK 128
|
#define ENOTSOCK 128
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user