summaryrefslogtreecommitdiff
path: root/network_io
diff options
context:
space:
mode:
authorstoddard <stoddard@13f79535-47bb-0310-9956-ffa450edef68>2002-05-22 20:06:32 +0000
committerstoddard <stoddard@13f79535-47bb-0310-9956-ffa450edef68>2002-05-22 20:06:32 +0000
commit799affbed15727bfd7a69595e88f4f05bb954117 (patch)
treea085bdc3a08b7e900cef460fe182f40411701116 /network_io
parent87d7deff2131869a46df0259ed1bd622791ac649 (diff)
downloadlibapr-799affbed15727bfd7a69595e88f4f05bb954117.tar.gz
Win32: WTF was I thinking with that last commit? this is right (I hope :-)
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63426 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'network_io')
-rw-r--r--network_io/win32/sendrecv.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c
index 321a5fed6..725278579 100644
--- a/network_io/win32/sendrecv.c
+++ b/network_io/win32/sendrecv.c
@@ -337,19 +337,17 @@ 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 (!disconnected && !GetOverlappedResult(wait_event, &overlapped,
- &nbytes, FALSE)) {
- status = APR_FROM_OS_ERROR(GetLastError());
- }
- else {
- status = APR_SUCCESS;
- /* Ugly Code Alert:
- * Account for the fact that GetOverlappedResult
- * tracks bytes sent in headers, trailers and the file
- * and this loop only needs to track bytes sent out
- * of the file.
+ status = APR_SUCCESS;
+ if (!disconnected) {
+ if (!GetOverlappedResult(wait_event, &overlapped,
+ &nbytes, FALSE)) {
+ status = APR_FROM_OS_ERROR(GetLastError());
+ }
+ /* Ugly code alert: GetOverlappedResult returns
+ * a count of all bytes sent. This loop only
+ * tracks bytes sent out of the file.
*/
- if (ptfb) {
+ else if (ptfb) {
nbytes -= (ptfb->HeadLength + ptfb->TailLength);
}
}