Connector alignment - final tweaks to the process method
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 6 Sep 2011 16:16:28 +0000 (16:16 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 6 Sep 2011 16:16:28 +0000 (16:16 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1165746 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/coyote/http11/Http11AprProcessor.java
java/org/apache/coyote/http11/Http11NioProcessor.java
java/org/apache/coyote/http11/Http11Processor.java

index 2456145..42af620 100644 (file)
@@ -172,7 +172,7 @@ public class Http11AprProcessor extends AbstractHttp11Processor<Long> {
         RequestInfo rp = request.getRequestProcessor();
         rp.setStage(org.apache.coyote.Constants.STAGE_PARSE);
 
-        // Setting up the socket
+        // Setting up the I/O
         this.socket = socketWrapper;
         inputBuffer.init(socketWrapper, endpoint);
         outputBuffer.init(socketWrapper, endpoint);
@@ -318,8 +318,7 @@ public class Http11AprProcessor extends AbstractHttp11Processor<Long> {
             }
             request.updateCounters();
 
-            if (!comet && !isAsync()) {
-                // Next request
+            if (!isAsync() && !comet || error) {
                 inputBuffer.nextRequest();
                 outputBuffer.nextRequest();
             }
@@ -339,7 +338,7 @@ public class Http11AprProcessor extends AbstractHttp11Processor<Long> {
 
         if (error || endpoint.isPaused()) {
             return SocketState.CLOSED;
-        } else if (comet  || isAsync()) {
+        } else if (comet || isAsync()) {
             return SocketState.LONG;
         } else {
             if (sendfileInProgress) {
index 6c9791e..d8fadd9 100644 (file)
@@ -201,7 +201,7 @@ public class Http11NioProcessor extends AbstractHttp11Processor<NioChannel> {
         RequestInfo rp = request.getRequestProcessor();
         rp.setStage(org.apache.coyote.Constants.STAGE_PARSE);
 
-        // Setting up the socket
+        // Setting up the I/O
         this.socket = socketWrapper;
         inputBuffer.init(socketWrapper, endpoint);
         outputBuffer.init(socketWrapper, endpoint);
@@ -329,7 +329,7 @@ public class Http11NioProcessor extends AbstractHttp11Processor<NioChannel> {
             rp.setStage(org.apache.coyote.Constants.STAGE_ENDINPUT);
 
             if (!isAsync() && !comet) {
-                if(error) {
+                if (error) {
                     // If we know we are closing the connection, don't drain
                     // input. This way uploading a 100GB file doesn't tie up the
                     // thread if the servlet has rejected it.
@@ -347,8 +347,7 @@ public class Http11NioProcessor extends AbstractHttp11Processor<NioChannel> {
             }
             request.updateCounters();
 
-            if (!comet && !isAsync()) {
-                // Next request
+            if (!isAsync() && !comet || error) {
                 inputBuffer.nextRequest();
                 outputBuffer.nextRequest();
             }
index 74176fb..da1f6e4 100644 (file)
@@ -263,7 +263,7 @@ public class Http11Processor extends AbstractHttp11Processor<Socket> {
             // Finish the handling of the request
             rp.setStage(org.apache.coyote.Constants.STAGE_ENDINPUT);
 
-            if(!isAsync() && !comet) {
+            if (!isAsync() && !comet) {
                 if (error) {
                     // If we know we are closing the connection, don't drain
                     // input. This way uploading a 100GB file doesn't tie up the
@@ -282,8 +282,7 @@ public class Http11Processor extends AbstractHttp11Processor<Socket> {
             }
             request.updateCounters();
 
-            // Next request
-            if (!isAsync() || error) {
+            if (!isAsync() && !comet || error) {
                 inputBuffer.nextRequest();
                 outputBuffer.nextRequest();
             }