Author: markt
Date: Tue Mar 10 21:08:18 2015
New Revision: 1665697
URL: http://svn.apache.org/r1665697
Log:
Let destroy() handle the socket close if the poller has stopped in case the
socket is already in the poller for a different event.
Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=1665697&r1=1665696&r2=1665697&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Tue Mar 10
21:08:18 2015
@@ -1489,21 +1489,13 @@ public class AprEndpoint extends Abstrac
// Always put a timeout in
timeout = Integer.MAX_VALUE;
}
- boolean ok = false;
synchronized (this) {
// Add socket to the list. Newly added sockets will wait
- // at most for pollTime before being polled. Don't add the
- // socket once the poller has stopped but destroy it straight
- // away
- if (pollerRunning && addList.add(socket, timeout, flags)) {
- ok = true;
+ // at most for pollTime before being polled.
+ if (addList.add(socket, timeout, flags)) {
this.notify();
}
}
- if (!ok) {
- // Can't do anything: close the socket right away
- closeSocket(socket);
- }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]