Index: file_io/win32/readwrite.c
===================================================================
RCS file: /home/cvspublic/apr/file_io/win32/readwrite.c,v
retrieving revision 1.80
diff -u -r1.80 readwrite.c
--- file_io/win32/readwrite.c	13 Feb 2004 09:38:27 -0000	1.80
+++ file_io/win32/readwrite.c	19 Jul 2004 16:15:52 -0000
@@ -305,8 +305,18 @@
             (*nbytes) = 0;
             rv = apr_get_os_error();
             if (rv == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) {
-                /* Wait for the pending i/o (put a timeout here?) */
-                rv = WaitForSingleObject(thefile->pOverlapped->hEvent, INFINITE);
+	       DWORD timemilliseconds=0;
+
+	       if(thefile->timeout<0)
+	       {
+		  timemilliseconds=INFINITE;
+	       }
+	       else if(thefile->timeout>0)
+	       {
+		  timemilliseconds=thefile->timeout / 1000;
+	       }
+	       
+                rv = WaitForSingleObject(thefile->pOverlapped->hEvent, timemilliseconds);
                 switch (rv) {
                     case WAIT_OBJECT_0:
                         GetOverlappedResult(thefile->filehand, thefile->pOverlapped, nbytes, TRUE);
