diff options
author | stoddard <stoddard@13f79535-47bb-0310-9956-ffa450edef68> | 2002-05-20 18:37:40 +0000 |
---|---|---|
committer | stoddard <stoddard@13f79535-47bb-0310-9956-ffa450edef68> | 2002-05-20 18:37:40 +0000 |
commit | 74be64c7a080ae644dfd79d16f45c87b749f5315 (patch) | |
tree | 748077f18bf9caf9d6237ef4857a7b949c63d494 | |
parent | 0bb868d7c4b001303da33628f7fd2423d9be3f99 (diff) | |
download | libapr-74be64c7a080ae644dfd79d16f45c87b749f5315.tar.gz |
Win32: Rather pointless to call GetOverlappedResults() on a socket we
just disconnected.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63419 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | network_io/win32/sendrecv.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c index 22284bae3..de6a3b573 100644 --- a/network_io/win32/sendrecv.c +++ b/network_io/win32/sendrecv.c @@ -252,6 +252,7 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, 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 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, if (flags & APR_SENDFILE_DISCONNECT_SOCKET) { dwFlags |= TF_REUSE_SOCKET; dwFlags |= TF_DISCONNECT; + disconnected = 1; } } @@ -336,8 +338,8 @@ APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file, (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 { |