apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r355812 - in /apr/apr/trunk: CHANGES file_io/win32/readwrite.c
Date Sat, 10 Dec 2005 23:55:14 GMT
Author: wrowe
Date: Sat Dec 10 15:55:06 2005
New Revision: 355812

URL: http://svn.apache.org/viewcvs?rev=355812&view=rev
Log:

  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/trunk/CHANGES
    apr/apr/trunk/file_io/win32/readwrite.c

Modified: apr/apr/trunk/CHANGES
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/CHANGES?rev=355812&r1=355811&r2=355812&view=diff
==============================================================================
--- apr/apr/trunk/CHANGES (original)
+++ apr/apr/trunk/CHANGES Sat Dec 10 15:55:06 2005
@@ -1,4 +1,8 @@
-Changes for APR ???
+Changes for APR 1.3.0
+
+  *) Cause apr_file_write_full on win32 to consider the timeout value set by 
+     apr_file_pipe_timeout_set.  PR 30182
+     [<eholyat olf.com>]
 
   *) Only include uuid/uuid.h if we haven't already included uuid.h, since
      doing so can result in type conflicts.
@@ -10,8 +14,6 @@
   *) Fix passing "" as an argument to the program started by apr_proc_create
      on Win32.
      [Philip Martin <philip codematters.co.uk>
-
-Changes for APR 1.3.0
 
   *) Bugfix for apr_pollset_poll() on systems that implement pollsets
      using select(2): properly compute the number of signalled desciptors

Modified: apr/apr/trunk/file_io/win32/readwrite.c
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/file_io/win32/readwrite.c?rev=355812&r1=355811&r2=355812&view=diff
==============================================================================
--- apr/apr/trunk/file_io/win32/readwrite.c (original)
+++ apr/apr/trunk/file_io/win32/readwrite.c Sat Dec 10 15:55:06 2005
@@ -311,8 +311,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