tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1296172 - in /tomcat/trunk/java/org/apache/coyote: AbstractProtocol.java ajp/AbstractAjpProtocol.java http11/Http11AprProtocol.java http11/Http11NioProtocol.java http11/Http11Protocol.java
Date Fri, 02 Mar 2012 12:41:54 GMT
Author: markt
Date: Fri Mar  2 12:41:54 2012
New Revision: 1296172

URL: http://svn.apache.org/viewvc?rev=1296172&view=rev
Log:
No need for an upgrade specific poll method. Delete some more code :)

Modified:
    tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java
    tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.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=1296172&r1=1296171&r2=1296172&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java Fri Mar  2 12:41:54 2012
@@ -591,7 +591,7 @@ public abstract class AbstractProtocol i
                     release(socket, processor, false, false);
                 } else if (state == SocketState.UPGRADED) {
                     // Need to keep the connection associated with the processor
-                    upgradePoll(socket, processor);
+                    longPoll(socket, processor);
                 } else {
                     // Connection closed. OK to recycle the processor.
                     if (!(processor instanceof UpgradeProcessor)) {
@@ -630,8 +630,6 @@ public abstract class AbstractProtocol i
                 Processor<S> processor);
         protected abstract void longPoll(SocketWrapper<S> socket,
                 Processor<S> processor);
-        protected abstract void upgradePoll(SocketWrapper<S> socket,
-                Processor<S> processor);
         protected abstract void release(SocketWrapper<S> socket,
                 Processor<S> processor, boolean socketClosing,
                 boolean addToPoller);

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=1296172&r1=1296171&r2=1296172&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java Fri Mar  2 12:41:54 2012
@@ -91,12 +91,6 @@ public abstract class AbstractAjpProtoco
         }
 
         @Override
-        protected void upgradePoll(SocketWrapper<S> socket,
-                Processor<S> processor) {
-            // TODO Should never happen. ISE?
-        }
-
-        @Override
         protected P createUpgradeProcessor(SocketWrapper<S> socket,
                 UpgradeInbound inbound) {
             // TODO should fail - throw IOE

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=1296172&r1=1296171&r2=1296172&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java Fri Mar  2 12:41:54
2012
@@ -293,22 +293,20 @@ public class Http11AprProtocol extends A
             connections.put(socket.getSocket(), processor);
 
             if (processor.isAsync()) {
+                // Async
                 socket.setAsync(true);
             } else if (processor.isComet() && proto.endpoint.isRunning()) {
+                // Comet
                 ((AprEndpoint) proto.endpoint).getCometPoller().add(
                         socket.getSocket().longValue(), false);
+            } else {
+                // Upgraded
+                ((AprEndpoint) proto.endpoint).getPoller().add(
+                        socket.getSocket().longValue(), false);
             }
         }
 
         @Override
-        protected void upgradePoll(SocketWrapper<Long> socket,
-                Processor<Long> processor) {
-            connections.put(socket.getSocket(), processor);
-            ((AprEndpoint) proto.endpoint).getPoller().add(
-                    socket.getSocket().longValue(), false);
-        }
-
-        @Override
         protected Http11AprProcessor createProcessor() {
             Http11AprProcessor processor = new Http11AprProcessor(
                     proto.getMaxHttpHeaderSize(), (AprEndpoint)proto.endpoint,

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=1296172&r1=1296171&r2=1296172&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java Fri Mar  2 12:41:54
2012
@@ -249,6 +249,7 @@ public class Http11NioProtocol extends A
             } else {
                 // Either:
                 //  - this is comet request
+                //  - this is an upgraded connection
                 //  - the request line/headers have not been completely
                 //    read
                 socket.getSocket().getPoller().add(socket.getSocket());
@@ -285,12 +286,5 @@ public class Http11NioProtocol extends A
             return new UpgradeNioProcessor(socket, inbound,
                     ((Http11NioProtocol) getProtocol()).getEndpoint().getSelectorPool());
         }
-
-        @Override
-        protected void upgradePoll(SocketWrapper<NioChannel> socket,
-                Processor<NioChannel> processor) {
-            connections.put(socket.getSocket(), processor);
-            socket.getSocket().getPoller().add(socket.getSocket());
-        }
     }
 }

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=1296172&r1=1296171&r2=1296172&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java Fri Mar  2 12:41:54 2012
@@ -191,11 +191,5 @@ public class Http11Protocol extends Abst
                 throws IOException {
             return new UpgradeBioProcessor(socket, inbound);
         }
-
-        @Override
-        protected void upgradePoll(SocketWrapper<Socket> socket,
-                Processor<Socket> processor) {
-            connections.put(socket.getSocket(), processor);
-        }
     }
 }



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


Mime
View raw message