apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From roo...@apache.org
Subject svn commit: r372436 - in /apr/apr/branches/1.2.x: CHANGES file_io/win32/readwrite.c
Date Thu, 26 Jan 2006 04:37:45 GMT
Author: rooneg
Date: Wed Jan 25 20:37:44 2006
New Revision: 372436

URL: http://svn.apache.org/viewcvs?rev=372436&view=rev
Log:
Merge r355812 to 1.2.x.

Original log message:

  Cause apr_file_write_full on win32 to consider the timeout value set by
  apr_file_pipe_timeout_set.  PR 30182  <eholyat olf.com>

  [also note the last changes are all still tracking to 1.3.0]

Modified:
    apr/apr/branches/1.2.x/CHANGES
    apr/apr/branches/1.2.x/file_io/win32/readwrite.c

Modified: apr/apr/branches/1.2.x/CHANGES
URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.2.x/CHANGES?rev=372436&r1=372435&r2=372436&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/CHANGES (original)
+++ apr/apr/branches/1.2.x/CHANGES Wed Jan 25 20:37:44 2006
@@ -2,6 +2,10 @@
 
   *) Keep testpipe.c from hanging on win32. [Garrett Rooney]
 
+  *) Cause apr_file_write_full on win32 to consider the timeout value set by 
+     apr_file_pipe_timeout_set.  PR 30182
+     [<eholyat olf.com>]
+
   *) Fix assertion from double close of a handle with a rwlock on win32.
      [Evgueni Brevnov <evgueni.brevnov gmail.com>]
 

Modified: apr/apr/branches/1.2.x/file_io/win32/readwrite.c
URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.2.x/file_io/win32/readwrite.c?rev=372436&r1=372435&r2=372436&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/file_io/win32/readwrite.c (original)
+++ apr/apr/branches/1.2.x/file_io/win32/readwrite.c Wed Jan 25 20:37:44 2006
@@ -310,8 +310,20 @@
             (*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 timeout_ms;
+
+                if (thefile->timeout == 0) {
+                    timeout_ms = 0;
+                }
+                else if (thefile->timeout < 0) {
+                    timeout_ms = INFINITE;
+                }
+                else {
+                    timeout_ms = thefile->timeout / 1000;
+                }
+	       
+                rv = WaitForSingleObject(thefile->pOverlapped->hEvent, timemilliseconds);
                 switch (rv) {
                     case WAIT_OBJECT_0:
                         GetOverlappedResult(thefile->filehand, thefile->pOverlapped,
(LPDWORD)nbytes, TRUE);



Mime
View raw message