wrowe 01/07/12 11:59:02
Modified: network_io/win32 sendrecv.c
Log:
Return LARGE_FILE support for win32 sendfile (quiets compiler)
Revision Changes Path
1.42 +6 -4 apr/network_io/win32/sendrecv.c
Index: sendrecv.c
===================================================================
RCS file: /home/cvs/apr/network_io/win32/sendrecv.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- sendrecv.c 2001/07/01 15:13:34 1.41
+++ sendrecv.c 2001/07/12 18:58:57 1.42
@@ -246,6 +246,7 @@
{
apr_status_t status = APR_SUCCESS;
apr_ssize_t rv;
+ apr_off_t curoff = *offset;
DWORD dwFlags = 0;
DWORD nbytes;
OVERLAPPED overlapped;
@@ -258,9 +259,6 @@
/* Initialize the overlapped structure */
memset(&overlapped,'\0', sizeof(overlapped));
- if (offset && *offset) {
- overlapped.Offset = *offset;
- }
#ifdef WAIT_FOR_EVENT
overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
#endif
@@ -310,6 +308,10 @@
}
}
+ overlapped.Offset = (DWORD)(curoff);
+#if APR_HAS_LARGE_FILES
+ overlapped.OffsetHigh = (DWORD)(curoff >> 32);
+#endif
rv = TransmitFile(sock->sock, /* socket */
file->filehand, /* open file descriptor of the
file to be sent */
nbytes, /* number of bytes to send. 0=send
all */
@@ -357,7 +359,7 @@
}
bytes_to_send -= nbytes;
*len += nbytes;
- overlapped.Offset += nbytes;
+ curoff += nbytes;
}