You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2016/04/11 21:19:03 UTC
svn commit: r1738624 -
/tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java
Author: markt
Date: Mon Apr 11 19:19:03 2016
New Revision: 1738624
URL: http://svn.apache.org/viewvc?rev=1738624&view=rev
Log:
Refactoring with a view to reducing the duplication between the two release() methods.
Modified:
tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java
Modified: tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java?rev=1738624&r1=1738623&r2=1738624&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java Mon Apr 11 19:19:03 2016
@@ -876,10 +876,7 @@ public abstract class AbstractProtocol<S
// Make sure socket/processor is removed from the list of current
// connections
connections.remove(socket);
- // Don't try to add upgrade processors back into the pool
- if (processor !=null && !processor.isUpgrade()) {
- release(processor);
- }
+ release(processor);
return SocketState.CLOSED;
}
@@ -910,8 +907,17 @@ public abstract class AbstractProtocol<S
* the socket)
*/
private void release(Processor processor) {
- processor.recycle();
- recycledProcessors.push(processor);
+ if (processor != null) {
+ processor.recycle();
+ // After recycling, only instances of UpgradeProcessorBase will
+ // return true for isUpgrade().
+ // Instances of UpgradeProcessorBase should not be added to
+ // recycledProcessors since that pool is only for AJP or HTTP
+ // processors
+ if (!processor.isUpgrade()) {
+ recycledProcessors.push(processor);
+ }
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org