summaryrefslogtreecommitdiff
path: root/poll
diff options
context:
space:
mode:
authorGreg Ames <gregames@apache.org>2013-01-18 00:06:20 +0000
committerGreg Ames <gregames@apache.org>2013-01-18 00:06:20 +0000
commit880b63861c28d20d680cfe19597e0c912bb19f20 (patch)
tree102f5fae185b0cb3716899e89b98c1df5da61f7e /poll
parentac6f26f29769b5207f72dd7291fd59bd0ca604aa (diff)
downloadapr-880b63861c28d20d680cfe19597e0c912bb19f20.tar.gz
apr_pollset_remove: use a separate aiocb pointing to the original for cancelling async i/o. this fixes a leak
in USS for every keepalive timeout combined with CPU growth on the httpd listener thread git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1434976 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poll')
-rw-r--r--poll/unix/z_asio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/poll/unix/z_asio.c b/poll/unix/z_asio.c
index b584e37cf..15b05060d 100644
--- a/poll/unix/z_asio.c
+++ b/poll/unix/z_asio.c
@@ -475,6 +475,7 @@ static apr_status_t asio_pollset_remove(apr_pollset_t *pollset,
asio_elem_t *elem;
apr_status_t rv = APR_SUCCESS;
apr_pollset_private_t *priv = pollset->p;
+ struct aiocb cancel_a; /* AIO_CANCEL is synchronous, so autodata works fine */
int fd;
@@ -503,7 +504,8 @@ static apr_status_t asio_pollset_remove(apr_pollset_t *pollset,
if (elem->state == ASIO_INIT) {
/* asyncio call to cancel */
- elem->a.aio_cmd = AIO_CANCEL;
+ cancel_a.aio_cmd = AIO_CANCEL;
+ cancel_a.aio_buf = &elem->a;
/* we want the original aiocb to show up on the pollset message queue
* to eliminate race conditions