Author: mladen.turk(a)jboss.com
Date: 2008-03-26 15:44:56 -0400 (Wed, 26 Mar 2008)
New Revision: 553
Modified:
trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
Log:
Fix core dump on server shutdown by destroying dereferenced socket
Modified: trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
===================================================================
--- trunk/java/org/apache/tomcat/util/net/AprEndpoint.java 2008-03-26 15:52:47 UTC (rev
552)
+++ trunk/java/org/apache/tomcat/util/net/AprEndpoint.java 2008-03-26 19:44:56 UTC (rev
553)
@@ -1795,21 +1795,30 @@
if (setSocketOptions(socket)) {
getPoller().add(socket);
} else {
- // Close socket and pool
- Socket.destroy(socket);
+ // Close socket and pool only if it wasn't closed
+ // already by the parent pool
+ if (serverSockPool != 0) {
+ Socket.destroy(socket);
+ }
socket = 0;
}
} else {
// Process the request from this socket
if ((status != null) && (handler.event(socket, status) ==
Handler.SocketState.CLOSED)) {
- // Close socket and pool
- Socket.destroy(socket);
+ // Close socket and pool only if it wasn't closed
+ // already by the parent pool
+ if (serverSockPool != 0) {
+ Socket.destroy(socket);
+ }
socket = 0;
} else if ((status == null) && ((options &&
!setSocketOptions(socket))
|| handler.process(socket) == Handler.SocketState.CLOSED)) {
- // Close socket and pool
- Socket.destroy(socket);
+ // Close socket and pool only if it wasn't closed
+ // already by the parent pool
+ if (serverSockPool != 0) {
+ Socket.destroy(socket);
+ }
socket = 0;
}
}
Show replies by date