*** Reverted in r1806701 ***
Minor refactoring of the Win32 file write code.
* file_io/win32/readwrite.c
(apr_file_write): Update filePtr in the asynchronous I/O mode after
the WriteFile() call.  This allows simplifying the condition by not
checking for thefile->pipe property.
Patch by: Evgeny Kotkov <evgeny.kotkov {at} visualsvn.com>
@@ -398,6 +398,9 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a
}
rv = WriteFile(thefile->filehand, buf, (DWORD)*nbytes, &bwrote,
thefile->pOverlapped);
+ if (rv == APR_SUCCESS && thefile->pOverlapped) {
+ thefile->filePtr += *nbytes;
+ }
if (thefile->append) {
apr_file_unlock(thefile);
apr_thread_mutex_unlock(thefile->mutex);
@@ -453,9 +456,6 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a
}
}
}
- if (rv == APR_SUCCESS && thefile->pOverlapped && !thefile->pipe) {
- thefile->filePtr += *nbytes;
- }
}
return rv;
}
