Author: mturk Date: Sat May 5 11:25:45 2012 New Revision: 1334401 URL: http://svn.apache.org/viewvc?rev=1334401&view=rev Log: Few more places that needs to decrement the connection counter when the socket is closed
Modified: tomcat/jk/trunk/native/common/jk_ajp_common.c Modified: tomcat/jk/trunk/native/common/jk_ajp_common.c URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_ajp_common.c?rev=1334401&r1=1334400&r2=1334401&view=diff ============================================================================== --- tomcat/jk/trunk/native/common/jk_ajp_common.c (original) +++ tomcat/jk/trunk/native/common/jk_ajp_common.c Sat May 5 11:25:45 2012 @@ -806,6 +806,7 @@ void ajp_close_endpoint(ajp_endpoint_t * ae->worker->name, ae->sd, ae->reuse ? "" : " (socket shutdown)"); if (IS_VALID_SOCKET(ae->sd)) { jk_shutdown_socket(ae->sd, l); + ae->worker->s->connected--; } ae->sd = JK_INVALID_SOCKET; jk_close_pool(&(ae->pool)); @@ -831,8 +832,10 @@ static int ajp_next_connection(ajp_endpo /* Close previous socket */ - if (IS_VALID_SOCKET(ae->sd)) + if (IS_VALID_SOCKET(ae->sd)) { jk_shutdown_socket(ae->sd, l); + ae->worker->s->connected--; + } /* Mark existing endpoint socket as closed */ ae->sd = JK_INVALID_SOCKET; @@ -3302,7 +3305,10 @@ int JK_METHOD ajp_maintain(jk_worker_t * * called from the watchdog thread. */ for (m = 0; m < m_count; m++) { - jk_shutdown_socket(m_sock[m], l); + if (m_sock[m] != JK_INVALID_SOCKET) { + jk_shutdown_socket(m_sock[m], l); + aw->s->connected--; + } } free(m_sock); if (n && JK_IS_DEBUG_LEVEL(l)) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org