summaryrefslogtreecommitdiff
path: root/file_io
diff options
context:
space:
mode:
authorWilliam A. Rowe Jr <wrowe@apache.org>2005-12-10 23:55:06 +0000
committerWilliam A. Rowe Jr <wrowe@apache.org>2005-12-10 23:55:06 +0000
commit1a98243a3f967598794ca245568df1328c7ba79a (patch)
tree2831b3a4f7ede9701f32e8b0d3acfaaa6dd767a0 /file_io
parentee2032aef5523440a822438def35114970e70319 (diff)
downloadapr-1a98243a3f967598794ca245568df1328c7ba79a.tar.gz
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] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@355812 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io')
-rw-r--r--file_io/win32/readwrite.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c
index 9d5eb1bd0..6d6a077fe 100644
--- a/file_io/win32/readwrite.c
+++ b/file_io/win32/readwrite.c
@@ -311,8 +311,20 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a
(*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);