From c21dbbc36ecde21d1f007da6f7869c74fc754fe2 Mon Sep 17 00:00:00 2001 From: markt Date: Mon, 5 Sep 2011 13:21:28 +0000 Subject: [PATCH] Move stage update to before point where we might break out of the keep-alive loop git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1165273 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/coyote/http11/Http11AprProcessor.java | 6 +++--- java/org/apache/coyote/http11/Http11NioProcessor.java | 6 +++--- java/org/apache/coyote/http11/Http11Processor.java | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/java/org/apache/coyote/http11/Http11AprProcessor.java b/java/org/apache/coyote/http11/Http11AprProcessor.java index fa6a1f1cc..22725ec03 100644 --- a/java/org/apache/coyote/http11/Http11AprProcessor.java +++ b/java/org/apache/coyote/http11/Http11AprProcessor.java @@ -316,7 +316,9 @@ public class Http11AprProcessor extends AbstractHttp11Processor { 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 { break; } } - - rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE); } rp.setStage(org.apache.coyote.Constants.STAGE_ENDED); diff --git a/java/org/apache/coyote/http11/Http11NioProcessor.java b/java/org/apache/coyote/http11/Http11NioProcessor.java index 6d68bdd2c..ae746cb6c 100644 --- a/java/org/apache/coyote/http11/Http11NioProcessor.java +++ b/java/org/apache/coyote/http11/Http11NioProcessor.java @@ -377,7 +377,9 @@ public class Http11NioProcessor extends AbstractHttp11Processor { 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 { (KeyAttachment) socketWrapper, true, true); break; } - - rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE); } rp.setStage(org.apache.coyote.Constants.STAGE_ENDED); diff --git a/java/org/apache/coyote/http11/Http11Processor.java b/java/org/apache/coyote/http11/Http11Processor.java index 0f006ba69..12642b785 100644 --- a/java/org/apache/coyote/http11/Http11Processor.java +++ b/java/org/apache/coyote/http11/Http11Processor.java @@ -310,13 +310,13 @@ public class Http11Processor extends AbstractHttp11Processor { 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); -- 2.11.0