X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=comstack%2Ftcpip.c;h=667accf49360959eea4e9ba7834ee46e04e205a1;hb=8030536c98d595898b316df5eb118b1d6398450c;hp=36cc696551b5af4acf6ef7a963757829826d993d;hpb=c03149b852e2937bd0637b21c3058a48dd25a739;p=yaz-moved-to-github.git diff --git a/comstack/tcpip.c b/comstack/tcpip.c index 36cc696..667accf 100644 --- a/comstack/tcpip.c +++ b/comstack/tcpip.c @@ -4,7 +4,13 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: tcpip.c,v $ - * Revision 1.23 1998-06-23 15:37:50 adam + * Revision 1.25 1998-07-07 15:49:23 adam + * Added braces to avoid warning. + * + * Revision 1.24 1998/06/29 07:59:17 adam + * Minor fix. + * + * Revision 1.23 1998/06/23 15:37:50 adam * Added type cast to prevent warning. * * Revision 1.22 1998/06/22 11:32:36 adam @@ -463,16 +469,17 @@ int tcpip_listen(COMSTACK h, char *raddr, int *addrlen, memcpy(raddr, &addr, *addrlen = sizeof(struct sockaddr_in)); else if (addrlen) *addrlen = 0; - -#if 1 if (check_ip && (*check_ip)(cd, (const char *) &addr.sin_addr, sizeof(addr.sin_addr), AF_INET)) { h->cerrno = CSDENY; - close (h->newfd); +#ifdef WINDOWS + closesocket(h->iofile); +#else + close(h->iofile); +#endif return -1; } -#endif h->state = CS_INCON; return 0; } @@ -556,6 +563,7 @@ int tcpip_get(COMSTACK h, char **buf, int *bufsize) if (!(*buf =(char *)xrealloc(*buf, *bufsize *= 2))) return -1; if ((res = recv(h->iofile, *buf + hasread, CS_TCPIP_BUFCHUNK, 0)) < 0) + { #ifdef WINDOWS if (WSAGetLastError() == WSAEWOULDBLOCK) #else @@ -568,6 +576,7 @@ int tcpip_get(COMSTACK h, char **buf, int *bufsize) break; else return -1; + } if (!res) return 0; hasread += res;