stoddard 02/05/20 11:37:40
Modified: network_io/win32 sendrecv.c
Log:
Win32: Rather pointless to call GetOverlappedResults() on a socket we
just disconnected.
Revision Changes Path
1.50 +4 -2 apr/network_io/win32/sendrecv.c
Index: sendrecv.c
===================================================================
RCS file: /home/cvs/apr/network_io/win32/sendrecv.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- sendrecv.c 20 May 2002 18:29:49 -0000 1.49
+++ sendrecv.c 20 May 2002 18:37:40 -0000 1.50
@@ -252,6 +252,7 @@
TRANSMIT_FILE_BUFFERS tfb, *ptfb = NULL;
int ptr = 0;
int bytes_to_send = *len; /* Bytes to send out of the file (not
including headers) */
+ int disconnected = 0;
if (apr_os_level < APR_WIN_NT) {
return APR_ENOTIMPL;
@@ -308,6 +309,7 @@
if (flags & APR_SENDFILE_DISCONNECT_SOCKET) {
dwFlags |= TF_REUSE_SOCKET;
dwFlags |= TF_DISCONNECT;
+ disconnected = 1;
}
}
@@ -336,8 +338,8 @@
(DWORD)(sock->timeout >= 0
? sock->timeout :
INFINITE));
if (rv == WAIT_OBJECT_0) {
- if (!GetOverlappedResult(event, &overlapped,
- &nbytes, FALSE)) {
+ if (!disconnected && !GetOverlappedResult(event,
&overlapped,
+ &nbytes,
FALSE)) {
status = APR_FROM_OS_ERROR(GetLastError());
}
else {