You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by be...@hyperreal.org on 1997/11/02 15:04:37 UTC
cvs commit: apachen/src/main buff.c
ben 97/11/02 06:04:37
Modified: src/main buff.c
Log:
Correct error checking in recvwithtimeout().
Revision Changes Path
1.49 +8 -4 apachen/src/main/buff.c
Index: buff.c
===================================================================
RCS file: /export/home/cvs/apachen/src/main/buff.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- buff.c 1997/11/01 21:13:20 1.48
+++ buff.c 1997/11/02 14:04:36 1.49
@@ -167,15 +167,19 @@
FD_SET(sock, &fdset);
tv.tv_usec = 0;
rv = select(FD_SETSIZE, &fdset, NULL, NULL, &tv);
- if (rv == 0) {
+ if (rv == SOCKET_ERROR)
+ err = WSAGetLastError();
+ else if (rv == 0) {
ioctlsocket(sock, FIONBIO, &iostate);
check_alarm();
WSASetLastError(WSAEWOULDBLOCK);
return (SOCKET_ERROR);
}
- rv = recv(sock, buf, len, flags);
- if (rv == SOCKET_ERROR)
- err = WSAGetLastError();
+ else {
+ rv = recv(sock, buf, len, flags);
+ if (rv == SOCKET_ERROR)
+ err = WSAGetLastError();
+ }
}
}
ioctlsocket(sock, FIONBIO, &iostate);