apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From roo...@apache.org
Subject svn commit: r372622 - in /apr/apr/branches/0.9.x: CHANGES file_io/win32/readwrite.c
Date Thu, 26 Jan 2006 21:50:49 GMT
Author: rooneg
Date: Thu Jan 26 13:50:48 2006
New Revision: 372622

URL: http://svn.apache.org/viewcvs?rev=372622&view=rev
Log:
Merge r355812 to 0.9.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/0.9.x/CHANGES
    apr/apr/branches/0.9.x/file_io/win32/readwrite.c

Modified: apr/apr/branches/0.9.x/CHANGES
URL: http://svn.apache.org/viewcvs/apr/apr/branches/0.9.x/CHANGES?rev=372622&r1=372621&r2=372622&view=diff
==============================================================================
--- apr/apr/branches/0.9.x/CHANGES (original)
+++ apr/apr/branches/0.9.x/CHANGES Thu Jan 26 13:50:48 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/0.9.x/file_io/win32/readwrite.c
URL: http://svn.apache.org/viewcvs/apr/apr/branches/0.9.x/file_io/win32/readwrite.c?rev=372622&r1=372621&r2=372622&view=diff
==============================================================================
--- apr/apr/branches/0.9.x/file_io/win32/readwrite.c (original)
+++ apr/apr/branches/0.9.x/file_io/win32/readwrite.c Thu Jan 26 13:50:48 2006
@@ -308,8 +308,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,
nbytes, TRUE);



Mime
View raw message