X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/c5e438ecf3f6d7b8caab10e43a452f3555149309..d9c40fd6ed72588278c633ee5db5c2eefad6ba7c:/unix/uxnet.c diff --git a/unix/uxnet.c b/unix/uxnet.c index ad25ef5f..2c9c7f17 100644 --- a/unix/uxnet.c +++ b/unix/uxnet.c @@ -208,13 +208,15 @@ SockAddr sk_namelookup(char *host, char **canonicalname) if ( (h = gethostbyname(host)) ) ret->family = AF_INET; } - if (ret->family == 0) + if (ret->family == 0) { ret->error = (h_errno == HOST_NOT_FOUND || h_errno == NO_DATA || h_errno == NO_ADDRESS ? "Host does not exist" : h_errno == TRY_AGAIN ? "Temporary name service failure" : "gethostbyname: unknown error"); + return ret; + } } #ifdef IPV6 @@ -808,10 +810,12 @@ int select_result(int fd, int event) /* * If we reach here, this is an oobinline socket, which - * means we should set s->oobpending and then fall through - * to the read case. + * means we should set s->oobpending and then deal with it + * when we get called for the readability event (which + * should also occur). */ s->oobpending = TRUE; + break; case 1: /* readable; also acceptance */ if (s->listener) { /* @@ -862,7 +866,7 @@ int select_result(int fd, int event) } else atmark = 1; - ret = recv(s->s, buf, sizeof(buf), 0); + ret = recv(s->s, buf, s->oobpending ? 1 : sizeof(buf), 0); noise_ultralight(ret); if (ret < 0) { if (errno == EWOULDBLOCK) {