Author: markt
Date: Thu Aug 22 10:00:22 2013
New Revision: 1516404

URL: http://svn.apache.org/r1516404
Log:
It is the socket that is the key for the connections map, not the processor
Align debug message with trunk code

Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/java/org/apache/coyote/AbstractProtocol.java

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1426662

Modified: tomcat/tc7.0.x/trunk/java/org/apache/coyote/AbstractProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/coyote/AbstractProtocol.java?rev=1516404&r1=1516403&r2=1516404&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/coyote/AbstractProtocol.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/coyote/AbstractProtocol.java Thu Aug 
22 10:00:22 2013
@@ -633,7 +633,7 @@ public abstract class AbstractProtocol i
                         inbound.onUpgradeComplete();
                     }
                     if (getLog().isDebugEnabled()) {
-                        getLog().debug("Socket: [" + socket +
+                        getLog().debug("Socket: [" + wrapper +
                                 "], Status in: [" + status +
                                 "], State out: [" + state + "]");
                     }
@@ -650,13 +650,13 @@ public abstract class AbstractProtocol i
                 } else if (state == SocketState.OPEN) {
                     // In keep-alive but between requests. OK to recycle
                     // processor. Continue to poll for the next request.
-                    connections.remove(processor);
+                    connections.remove(socket);
                     release(wrapper, processor, false, true);
                 } else if (state == SocketState.SENDFILE) {
                     // Sendfile in progress. If it fails, the socket will be
                     // closed. If it works, the socket will be re-added to the
                     // poller
-                    connections.remove(processor);
+                    connections.remove(socket);
                     release(wrapper, processor, false, false);
                 } else if (state == SocketState.UPGRADED) {
                     // Need to keep the connection associated with the 
processor
@@ -665,7 +665,7 @@ public abstract class AbstractProtocol i
                 } else {
                     // Connection closed. OK to recycle the processor. Upgrade
                     // processors are not recycled.
-                    connections.remove(processor);
+                    connections.remove(socket);
                     if (!(processor instanceof 
org.apache.coyote.http11.upgrade.UpgradeProcessor)
                             && !processor.isUpgrade()) {
                         release(wrapper, processor, true, false);
@@ -692,6 +692,9 @@ public abstract class AbstractProtocol i
                 getLog().error(
                         sm.getString("abstractConnectionHandler.error"), e);
             }
+            // 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 instanceof 
org.apache.coyote.http11.upgrade.UpgradeProcessor)
                     && !processor.isUpgrade()) {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to