Author: markt
Date: Mon Sep  5 12:09:28 2011
New Revision: 1165253

URL: http://svn.apache.org/viewvc?rev=1165253&view=rev
Log:
Start to align the request finish code

Modified:
    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/Http11AprProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=1165253&r1=1165252&r2=1165253&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Mon Sep  
5 12:09:28 2011
@@ -290,15 +290,20 @@ public class Http11AprProcessor extends 
             }
 
             // Finish the handling of the request
-            if (!comet && !isAsync()) {
-                // 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.
-                if(error)
+            rp.setStage(org.apache.coyote.Constants.STAGE_ENDINPUT);
+
+            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
+                    // thread if the servlet has rejected it.
                     inputBuffer.setSwallowInput(false);
+                }
                 endRequest();
             }
 
+            rp.setStage(org.apache.coyote.Constants.STAGE_ENDOUTPUT);
+
             // If there was an error, make sure the request is counted as
             // and error, and update the statistics counter
             if (error) {
@@ -336,7 +341,6 @@ public class Http11AprProcessor extends 
             }
             
             rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE);
-
         }
 
         rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);

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=1165253&r1=1165252&r2=1165253&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Mon Sep  
5 12:09:28 2011
@@ -351,15 +351,20 @@ public class Http11NioProcessor extends 
             }
 
             // Finish the handling of the request
-            if (!comet && !isAsync()) {
-                // 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.
-                if(error)
+            rp.setStage(org.apache.coyote.Constants.STAGE_ENDINPUT);
+
+            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
+                    // thread if the servlet has rejected it.
                     inputBuffer.setSwallowInput(false);
+                }
                 endRequest();
             }
 
+            rp.setStage(org.apache.coyote.Constants.STAGE_ENDOUTPUT);
+
             // If there was an error, make sure the request is counted as
             // and error, and update the statistics counter
             if (error) {
@@ -385,10 +390,8 @@ public class Http11NioProcessor extends 
                 break;
             }
 
-
             rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE);
-
-        }//while
+        }
 
         rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
         if (error || endpoint.isPaused()) {

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=1165253&r1=1165252&r2=1165253&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java Mon Sep  5 
12:09:28 2011
@@ -284,16 +284,16 @@ public class Http11Processor extends Abs
 
             // Finish the handling of the request
             rp.setStage(org.apache.coyote.Constants.STAGE_ENDINPUT);
-            
-            if(error && !isAsync()) {
-                // 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.
-                inputBuffer.setSwallowInput(false);
-            }
 
-            if (!isAsync())
+            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
+                    // thread if the servlet has rejected it.
+                    inputBuffer.setSwallowInput(false);
+                }
                 endRequest();
+            }
 
             rp.setStage(org.apache.coyote.Constants.STAGE_ENDOUTPUT);
 
@@ -304,11 +304,6 @@ public class Http11Processor extends Abs
             }
             request.updateCounters();
 
-            rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE);
-
-            // Don't reset the param - we'll see it as ended. Next request
-            // will reset it
-            // thrA.setParam(null);
             // Next request
             if (!isAsync() || error) {
                 inputBuffer.nextRequest();
@@ -320,6 +315,8 @@ public class Http11Processor extends Abs
             if (isAsync() || error || inputBuffer.lastValid == 0) {
                 break;
             }
+
+            rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE);
         }
 
         rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);



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

Reply via email to