tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1478604 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractHttp11Processor.java Http11AprProcessor.java Http11NioProcessor.java Http11Processor.java
Date Thu, 02 May 2013 23:21:26 GMT
Author: markt
Date: Thu May  2 23:21:25 2013
New Revision: 1478604

URL: http://svn.apache.org/r1478604
Log:
Pull up changes to process()

Modified:
    tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1478604&r1=1478603&r2=1478604&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Thu May  2 23:21:25
2013
@@ -1045,6 +1045,8 @@ public abstract class AbstractHttp11Proc
 
         rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
 
+        registerForWrite();
+
         if (error || endpoint.isPaused()) {
             return SocketState.CLOSED;
         } else if (isAsync() || comet) {
@@ -1070,6 +1072,32 @@ public abstract class AbstractHttp11Proc
 
 
     /**
+     * Register the socket for write possible events of there is data in the
+     * output buffer still to write.
+     *
+     * @return <code>true</code> if the socket was registered for write possible
+     *         events, otherwise <code>false</code>
+     */
+    protected boolean registerForWrite() {
+        if (outputBuffer.hasDataToWrite()) {
+            registerForEvent(false, true);
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+
+    /**
+     * Regsiter the socket for the specified events.
+     *
+     * @param read  Register the socket for read events
+     * @param write Regsiter the socket for write events
+     */
+    protected abstract void registerForEvent(boolean read, boolean write);
+
+
+    /**
      * After reading the request headers, we have to setup the request filters.
      */
     protected void prepareRequest() {

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=1478604&r1=1478603&r2=1478604&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Thu May  2 23:21:25
2013
@@ -239,8 +239,15 @@ public class Http11AprProcessor extends 
 
 
     @Override
+    protected void registerForEvent(boolean read, boolean write) {
+        ((AprEndpoint) endpoint).getPoller().add(
+                socket.getSocket().longValue(), -1, read, write);
+    }
+
+
+    @Override
     protected void resetTimeouts() {
-        // NOOP for APR
+        // NO-OP for APR
     }
 
 

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java?rev=1478604&r1=1478603&r2=1478604&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Thu May  2 23:21:25
2013
@@ -216,27 +216,7 @@ public class Http11NioProcessor extends 
     }
 
 
-
     @Override
-    public SocketState process(SocketWrapper<NioChannel> socketWrapper)
-            throws IOException {
-        SocketState state = super.process(socketWrapper);
-        registerForWrite();
-        return state;
-    }
-
-
-    protected boolean registerForWrite() {
-        // Register for write if we have more data to write
-        if (outputBuffer.hasDataToWrite()) {
-            registerForEvent(false, true);
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-
     protected void registerForEvent(boolean read, boolean write) {
         final NioEndpoint.KeyAttachment attach =
                 (NioEndpoint.KeyAttachment)socket.getSocket().getAttachment(

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java?rev=1478604&r1=1478603&r2=1478604&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java Thu May  2 23:21:25 2013
@@ -206,8 +206,13 @@ public class Http11Processor extends Abs
 
 
     @Override
+    protected void registerForEvent(boolean read, boolean write) {
+        // NO-OP for BIO
+    }
+
+    @Override
     protected void resetTimeouts() {
-        // NOOP for BIO
+        // NO-OP for BIO
     }
 
 



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


Mime
View raw message