tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1478713 - /tomcat/trunk/java/org/apache/coyote/http11/
Date Fri, 03 May 2013 10:15:07 GMT
Author: markt
Date: Fri May  3 10:15:06 2013
New Revision: 1478713

URL: http://svn.apache.org/r1478713
Log:
Servlet 3.1 non-blocking refactoring
Pull up InputBuffer to AbstractHttp11Processor

Modified:
    tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
    tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.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
    tomcat/trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java
    tomcat/trunk/java/org/apache/coyote/http11/InternalInputBuffer.java
    tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.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=1478713&r1=1478712&r2=1478713&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Fri May  3 10:15:06
2013
@@ -65,6 +65,12 @@ public abstract class AbstractHttp11Proc
 
 
     /**
+     * Input.
+     */
+    protected AbstractInputBuffer<S> inputBuffer ;
+
+
+    /**
      * Output.
      */
     protected AbstractOutputBuffer<S> outputBuffer;

Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java?rev=1478713&r1=1478712&r2=1478713&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractInputBuffer.java Fri May  3 10:15:06
2013
@@ -238,9 +238,14 @@ public abstract class AbstractInputBuffe
     protected abstract void init(SocketWrapper<S> socketWrapper,
             AbstractEndpoint endpoint) throws IOException;
 
+    /**
+     * Issues a non blocking read.
+     * @return int  Number of bytes read
+     */
+    protected abstract int nbRead() throws IOException;
 
-    // --------------------------------------------------------- Public Methods
 
+    // --------------------------------------------------------- Public Methods
 
     /**
      * Recycle the input buffer. This should be called when closing the

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=1478713&r1=1478712&r2=1478713&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Fri May  3 10:15:06
2013
@@ -74,13 +74,6 @@ public class Http11AprProcessor extends 
 
     // ----------------------------------------------------- Instance Variables
 
-
-    /**
-     * Input.
-     */
-    protected final InternalAprInputBuffer inputBuffer;
-
-
     /**
      * Sendfile data.
      */

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=1478713&r1=1478712&r2=1478713&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Fri May  3 10:15:06
2013
@@ -79,11 +79,6 @@ public class Http11NioProcessor extends 
 
 
     // ----------------------------------------------------- Instance Variables
-    /**
-     * Input.
-     */
-    protected final InternalNioInputBuffer inputBuffer;
-
 
     /**
      * Sendfile data.
@@ -283,7 +278,8 @@ public class Http11NioProcessor extends 
         // open
         openSocket = true;
         // Check to see if we have read any of the request line yet
-        if (inputBuffer.getParsingRequestLinePhase() < 2) {
+        if (((InternalNioInputBuffer)
+                inputBuffer).getParsingRequestLinePhase() < 2) {
             if (socket.getLastAccess() > -1 || keptAlive) {
                 // Haven't read the request line and have previously processed a
                 // request. Must be keep-alive. Make sure poller uses keepAlive.

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=1478713&r1=1478712&r2=1478713&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java Fri May  3 10:15:06 2013
@@ -66,13 +66,6 @@ public class Http11Processor extends Abs
 
     // ----------------------------------------------------- Instance Variables
 
-
-    /**
-     * Input.
-     */
-    protected final InternalInputBuffer inputBuffer ;
-
-
     /**
      * SSL information.
      */
@@ -164,7 +157,8 @@ public class Http11Processor extends Abs
                 }
             }
             socket.getSocket().setSoTimeout(firstReadTimeout);
-            if (!inputBuffer.fill()) {
+            // Blocking IO so fill() always blocks
+            if (!inputBuffer.fill(true)) {
                 throw new EOFException(sm.getString("iib.eof.error"));
             }
             // Once the first byte has been read, the standard timeout should be

Modified: tomcat/trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java?rev=1478713&r1=1478712&r2=1478713&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/InternalAprInputBuffer.java Fri May  3 10:15:06
2013
@@ -629,9 +629,15 @@ public class InternalAprInputBuffer exte
     }
 
 
-    // ------------------------------------- InputStreamInputBuffer Inner Class
+    @Override
+    protected int nbRead() throws IOException {
+        // TODO Auto-generated method stub
+        return 0;
+    }
 
 
+    // ------------------------------------- InputStreamInputBuffer Inner Class
+
     /**
      * This class is an input buffer which will read its data from an input
      * stream.

Modified: tomcat/trunk/java/org/apache/coyote/http11/InternalInputBuffer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/InternalInputBuffer.java?rev=1478713&r1=1478712&r2=1478713&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/InternalInputBuffer.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/InternalInputBuffer.java Fri May  3 10:15:06
2013
@@ -547,9 +547,15 @@ public class InternalInputBuffer extends
     }
 
 
-    // ------------------------------------- InputStreamInputBuffer Inner Class
+    @Override
+    protected int nbRead() throws IOException {
+        // TODO Auto-generated method stub
+        return 0;
+    }
 
 
+    // ------------------------------------- InputStreamInputBuffer Inner Class
+
     /**
      * This class is an input buffer which will read its data from an input
      * stream.

Modified: tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java?rev=1478713&r1=1478712&r2=1478713&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java Fri May  3 10:15:06
2013
@@ -189,17 +189,13 @@ public class InternalNioInputBuffer exte
         return available;
     }
 
-    /**
-     * Issues a non blocking read
-     * @return int - nr of bytes read
-     * @throws IOException
-     */
+
+    @Override
     public int nbRead() throws IOException {
         return readSocket(true,false);
     }
 
 
-
     /**
      * Recycle the input buffer. This should be called when closing the
      * connection.



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


Mime
View raw message