httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@hyperreal.org
Subject cvs commit: apachen/src/main buff.c
Date Sun, 02 Nov 1997 14:04:37 GMT
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);
  
  
  

Mime
View raw message