From 0e6bd3b14368d725d4327894d43b5d7b5e4ea43d Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Fri, 2 Sep 2016 18:46:35 +0000 Subject: clear the aiocb structure used for asyncio cancel The underlying syscall sanity checks some fields we don't later specify, possibly even some fields that are n/a for a cancel operation, which may result in a cancel call failing. outstanding aysnc I/O requests are cancelled when the fd is closed, but with very long-lived sockets, failing cancels could result in elevated CPU during BP4XAIO of type select or cancel. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1759009 13f79535-47bb-0310-9956-ffa450edef68 --- poll/unix/z_asio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'poll') diff --git a/poll/unix/z_asio.c b/poll/unix/z_asio.c index 6da4ee8e9..ae03079fb 100644 --- a/poll/unix/z_asio.c +++ b/poll/unix/z_asio.c @@ -483,7 +483,8 @@ 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 */ + /* AIO_CANCEL is synchronous, so autodata works fine. */ + struct aiocb cancel_a = {0}; int fd; -- cgit v1.2.1