diff options
author | Ivan Zhakov <ivan@apache.org> | 2019-05-26 08:46:08 +0000 |
---|---|---|
committer | Ivan Zhakov <ivan@apache.org> | 2019-05-26 08:46:08 +0000 |
commit | 12e32ba4bcafcabce18c53ec63979cb7335b1bb9 (patch) | |
tree | 0ee027b936b7b1952b494adfead4b121d0e32ca5 | |
parent | 6ebf67708def75ae41335ef4a534c6cc64764d3a (diff) | |
download | apr-12e32ba4bcafcabce18c53ec63979cb7335b1bb9.tar.gz |
* file_io/win32/readwrite.c
(apr_file_write): Use CancelIoEx() instead of CancelIo() to protect from
potential race condition.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1860038 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | file_io/win32/open.c | 2 | ||||
-rw-r--r-- | file_io/win32/readwrite.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/file_io/win32/open.c b/file_io/win32/open.c index b6c01432e..f3b93f5ae 100644 --- a/file_io/win32/open.c +++ b/file_io/win32/open.c @@ -260,7 +260,7 @@ static apr_status_t make_sparse_file(apr_file_t *file) } while (res == WAIT_ABANDONED); if (res != WAIT_OBJECT_0) { - CancelIo(file->filehand); + CancelIoEx(file->filehand, file->pOverlapped); } if (GetOverlappedResult(file->filehand, file->pOverlapped, diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 96222d8e4..ef3f7ad85 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -99,7 +99,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le * the operation in progress. */ if (res != WAIT_OBJECT_0) { - CancelIo(file->filehand); + CancelIoEx(file->filehand, file->pOverlapped); } /* Ignore any failures above. Attempt to complete @@ -523,7 +523,7 @@ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, a break; } if (rv != APR_SUCCESS) { - CancelIo(thefile->filehand); + CancelIoEx(thefile->filehand, thefile->pOverlapped); } } } |