tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1144557 - in /tomcat/trunk/java/org/apache/coyote: AbstractProtocol.java ajp/AbstractAjpProtocol.java ajp/AjpNioProtocol.java http11/Http11AprProtocol.java http11/Http11NioProtocol.java http11/Http11Protocol.java
Date Sat, 09 Jul 2011 00:28:45 GMT
Author: markt
Date: Sat Jul  9 00:28:44 2011
New Revision: 1144557

URL: http://svn.apache.org/viewvc?rev=1144557&view=rev
Log:
Fix Comet with HTTP/APR connector
r1144391 switched the key for the processor map for this connector from the socket to the
socket wrapper. That prevented Comet from being able to retrieve the processor from the map
when processing a comet event.
This commit changes all the connectors to map the socket (or rather whatever the SocketWrapper
wraps) to the processor rather than the SocketWrapper.

Modified:
    tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java
    tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
    tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.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=1144557&r1=1144556&r2=1144557&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java Sat Jul  9 00:28:44 2011
@@ -468,8 +468,8 @@ public abstract class AbstractProtocol i
         protected RequestGroupInfo global = new RequestGroupInfo();
         protected AtomicLong registerCount = new AtomicLong(0);
 
-        protected ConcurrentHashMap<SocketWrapper<S>,P> connections =
-            new ConcurrentHashMap<SocketWrapper<S>,P>();
+        protected ConcurrentHashMap<S,P> connections =
+            new ConcurrentHashMap<S,P>();
 
         protected RecycledProcessors<P,S> recycledProcessors =
             new RecycledProcessors<P,S>(this);
@@ -491,7 +491,7 @@ public abstract class AbstractProtocol i
 
         public SocketState process(SocketWrapper<S> socket,
                 SocketStatus status) {
-            P processor = connections.remove(socket);
+            P processor = connections.remove(socket.getSocket());
 
             socket.setAsync(false);
 

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java?rev=1144557&r1=1144556&r2=1144557&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java Sat Jul  9 00:28:44 2011
@@ -83,7 +83,7 @@ public abstract class AbstractAjpProtoco
         @Override
         protected void longPoll(SocketWrapper<S> socket, P processor) {
             // Same requirements for all AJP connectors
-            connections.put(socket, processor);
+            connections.put(socket.getSocket(), processor);
             socket.setAsync(true);
         }
     }

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java?rev=1144557&r1=1144556&r2=1144557&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java Sat Jul  9 00:28:44 2011
@@ -120,10 +120,10 @@ public class AjpNioProtocol extends Abst
             if (log.isDebugEnabled()) 
                 log.debug("Iterating through our connections to release a socket channel:"+socket);
             boolean released = false;
-            Iterator<java.util.Map.Entry<SocketWrapper<NioChannel>, AjpNioProcessor>>
it = connections.entrySet().iterator();
+            Iterator<java.util.Map.Entry<NioChannel, AjpNioProcessor>> it = connections.entrySet().iterator();
             while (it.hasNext()) {
-                java.util.Map.Entry<SocketWrapper<NioChannel>, AjpNioProcessor>
entry = it.next();
-                if (entry.getKey().getSocket().getIOChannel()==socket) {
+                java.util.Map.Entry<NioChannel, AjpNioProcessor> entry = it.next();
+                if (entry.getKey().getIOChannel()==socket) {
                     it.remove();
                     AjpNioProcessor result = entry.getValue();
                     result.recycle(true);

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java?rev=1144557&r1=1144556&r2=1144557&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java Sat Jul  9 00:28:44
2011
@@ -230,7 +230,7 @@ public class Http11AprProtocol extends A
         @Override
         protected void longPoll(SocketWrapper<Long> socket,
                 Http11AprProcessor processor) {
-            connections.put(socket, processor);
+            connections.put(socket.getSocket(), processor);
 
             if (processor.isAsync()) {
                 socket.setAsync(true);

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java?rev=1144557&r1=1144556&r2=1144557&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java Sat Jul  9 00:28:44
2011
@@ -182,10 +182,10 @@ public class Http11NioProtocol extends A
             if (log.isDebugEnabled()) 
                 log.debug("Iterating through our connections to release a socket channel:"+socket);
             boolean released = false;
-            Iterator<java.util.Map.Entry<SocketWrapper<NioChannel>, Http11NioProcessor>>
it = connections.entrySet().iterator();
+            Iterator<java.util.Map.Entry<NioChannel, Http11NioProcessor>> it
= connections.entrySet().iterator();
             while (it.hasNext()) {
-                java.util.Map.Entry<SocketWrapper<NioChannel>, Http11NioProcessor>
entry = it.next();
-                if (entry.getKey().getSocket().getIOChannel()==socket) {
+                java.util.Map.Entry<NioChannel, Http11NioProcessor> entry = it.next();
+                if (entry.getKey().getIOChannel()==socket) {
                     it.remove();
                     Http11NioProcessor result = entry.getValue();
                     result.recycle();
@@ -252,7 +252,7 @@ public class Http11NioProtocol extends A
         @Override
         protected void longPoll(SocketWrapper<NioChannel> socket,
                 Http11NioProcessor processor) {
-            connections.put(socket, processor);
+            connections.put(socket.getSocket(), processor);
             
             if (processor.isAsync()) {
                 socket.setAsync(true);

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java?rev=1144557&r1=1144556&r2=1144557&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java Sat Jul  9 00:28:44 2011
@@ -153,7 +153,7 @@ public class Http11Protocol extends Abst
         @Override
         protected void longPoll(SocketWrapper<Socket> socket,
                 Http11Processor processor) {
-            connections.put(socket, processor);
+            connections.put(socket.getSocket(), processor);
         }
 
         @Override



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


Mime
View raw message