apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grega...@apache.org
Subject svn commit: r1434976 - /apr/apr/trunk/poll/unix/z_asio.c
Date Fri, 18 Jan 2013 00:06:34 GMT
Author: gregames
Date: Fri Jan 18 00:06:20 2013
New Revision: 1434976

URL: http://svn.apache.org/viewvc?rev=1434976&view=rev
Log:
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 

Modified:
    apr/apr/trunk/poll/unix/z_asio.c

Modified: apr/apr/trunk/poll/unix/z_asio.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/z_asio.c?rev=1434976&r1=1434975&r2=1434976&view=diff
==============================================================================
--- apr/apr/trunk/poll/unix/z_asio.c (original)
+++ apr/apr/trunk/poll/unix/z_asio.c Fri Jan 18 00:06:20 2013
@@ -475,6 +475,7 @@ static apr_status_t asio_pollset_remove(
     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(
 
         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



Mime
View raw message