Skip to content

Commit

Permalink
Cause apr_file_write_full on win32 to consider the timeout value set by
Browse files Browse the repository at this point in the history
  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
  • Loading branch information
wrowe committed Dec 10, 2005
1 parent ee2032a commit 1a98243
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
8 changes: 5 additions & 3 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -11,8 +15,6 @@ Changes for APR ???
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
when one or more of them are both readable and writable.
Expand Down
16 changes: 14 additions & 2 deletions file_io/win32/readwrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1a98243

Please sign in to comment.