Fix timeouts broken by refactoring
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 6 Sep 2011 18:39:41 +0000 (18:39 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 6 Sep 2011 18:39:41 +0000 (18:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1165777 13f79535-47bb-0310-9956-ffa450edef68

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

index d8fadd9..6ad66d4 100644 (file)
@@ -420,16 +420,16 @@ public class Http11NioProcessor extends AbstractHttp11Processor<NioChannel> {
         // open
         openSocket = true;
         // Check to see if we have read any of the request line yet
-        if (inputBuffer.getParsingRequestLinePhase()<2) {
-            // No data read, OK to recycle the processor
-            // Continue to use keep alive timeout
-            if (keepAliveTimeout>0) {
-                socket.setTimeout(keepAliveTimeout);
-            }
+        if (inputBuffer.getParsingRequestLinePhase() < 2) {
+            // Haven't read the request line. Must be keep-alive
+            // Make sure poller uses keepAlive from here onwards
+            socket.setTimeout(endpoint.getKeepAliveTimeout());
         } else {
             // Started to read request line. Need to keep processor
             // associated with socket
             readComplete = false;
+            // Make sure poller uses soTimeout from here onwards
+            socket.setTimeout(endpoint.getSoTimeout());
         }
         if (endpoint.isPaused()) {
             // 503 - Service unavailable