You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by st...@locus.apache.org on 2000/08/04 04:42:33 UTC
cvs commit: apache-2.0/src/lib/apr/network_io/win32 sendrecv.c sockopt.c
stoddard 00/08/03 19:42:33
Modified: src/lib/apr/network_io/win32 sendrecv.c sockopt.c
Log:
Win32: Fix problem with timeout units on TransmitFile.
Revision Changes Path
1.24 +2 -2 apache-2.0/src/lib/apr/network_io/win32/sendrecv.c
Index: sendrecv.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/win32/sendrecv.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- sendrecv.c 2000/08/02 05:26:31 1.23
+++ sendrecv.c 2000/08/04 02:42:32 1.24
@@ -239,10 +239,10 @@
if (lasterror == ERROR_IO_PENDING) {
#ifdef WAIT_FOR_EVENT
rv = WaitForSingleObject(overlapped.hEvent,
- sock->timeout >= 0 ? sock->timeout / 1000 : INFINITE);
+ sock->timeout >= 0 ? sock->timeout : INFINITE);
#else
rv = WaitForSingleObject((HANDLE) sock->sock,
- sock->timeout >= 0 ? sock->timeout / 1000 : INFINITE);
+ sock->timeout >= 0 ? sock->timeout : INFINITE);
#endif
if (rv == WAIT_OBJECT_0)
lasterror = APR_SUCCESS;
1.23 +7 -5 apache-2.0/src/lib/apr/network_io/win32/sockopt.c
Index: sockopt.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/win32/sockopt.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- sockopt.c 2000/08/02 05:26:31 1.22
+++ sockopt.c 2000/08/04 02:42:32 1.23
@@ -92,8 +92,10 @@
if (on <= 0)
new_timeout = on;
else
- new_timeout = on/1000; /* Windows needs timeout in mSeconds */
-
+ /* Convert from APR units (microseconds) to windows units
+ * (milliseconds) */
+ new_timeout = on/1000;
+
if (new_timeout == 0) {
/* Set the socket non-blocking if it was previously blocking */
if (sock->timeout != 0) {
@@ -170,9 +172,9 @@
{
switch (opt) {
case APR_SO_TIMEOUT:
- /* Do we want to store sock->timeout in APR units or windows units? */
- *on = sock->timeout * 1000; /* Convert from milliseconds (windows units) to microseconds
- * (APR units) */
+ /* Convert from milliseconds (windows units) to microseconds
+ * (APR units) */
+ *on = sock->timeout * 1000;
break;
case APR_SO_DISCONNECTED:
*on = sock->disconnected;