Move stage update to before point where we might break out of the keep-alive loop
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 5 Sep 2011 13:21:28 +0000 (13:21 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 5 Sep 2011 13:21:28 +0000 (13:21 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1165273 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 fa6a1f1..22725ec 100644 (file)
@@ -316,7 +316,9 @@ public class Http11AprProcessor extends AbstractHttp11Processor<Long> {
                 inputBuffer.nextRequest();
                 outputBuffer.nextRequest();
             }
-            
+
+            rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE);
+
             // Do sendfile as needed: add socket to sendfile and end
             if (sendfileData != null && !error) {
                 sendfileData.socket = socketRef;
@@ -339,8 +341,6 @@ public class Http11AprProcessor extends AbstractHttp11Processor<Long> {
                     break;
                 }
             }
-            
-            rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE);
         }
 
         rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
index 6d68bdd..ae746cb 100644 (file)
@@ -377,7 +377,9 @@ public class Http11NioProcessor extends AbstractHttp11Processor<NioChannel> {
                 inputBuffer.nextRequest();
                 outputBuffer.nextRequest();
             }
-            
+
+            rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE);
+
             // Do sendfile as needed: add socket to sendfile and end
             if (sendfileData != null && !error) {
                 ((KeyAttachment) socketWrapper).setSendfileData(sendfileData);
@@ -389,8 +391,6 @@ public class Http11NioProcessor extends AbstractHttp11Processor<NioChannel> {
                         (KeyAttachment) socketWrapper, true, true);
                 break;
             }
-
-            rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE);
         }
 
         rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
index 0f006ba..12642b7 100644 (file)
@@ -310,13 +310,13 @@ public class Http11Processor extends AbstractHttp11Processor<Socket> {
                 outputBuffer.nextRequest();
             }
 
+            rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE);
+
             // If we don't have a pipe-lined request allow this thread to be
             // used by another connection
             if (isAsync() || error || inputBuffer.lastValid == 0) {
                 break;
             }
-
-            rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE);
         }
 
         rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);