If we know we are closing the connection, don't drain input.
authorbillbarker <billbarker@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 15 Nov 2008 02:30:12 +0000 (02:30 +0000)
committerbillbarker <billbarker@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 15 Nov 2008 02:30:12 +0000 (02:30 +0000)
This way uploading a 100GB file doesn't tie up the thread
if the servlet has rejected it.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@714214 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 b1908ac..fae37f9 100644 (file)
@@ -860,6 +860,11 @@ public class Http11AprProcessor implements ActionHook {
 
             // Finish the handling of the request
             if (!comet) {
+                // 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)
+                    inputBuffer.setSwallowInput(false);
                 endRequest();
             }
 
index 5214336..70a4784 100644 (file)
@@ -893,6 +893,11 @@ public class Http11NioProcessor implements ActionHook {
 
             // Finish the handling of the request
             if (!comet) {
+                // 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)
+                    inputBuffer.setSwallowInput(false);
                 endRequest();
             }
 
index 03f8c24..812eef7 100644 (file)
@@ -850,6 +850,11 @@ public class Http11Processor implements ActionHook {
             // Finish the handling of the request
             try {
                 rp.setStage(org.apache.coyote.Constants.STAGE_ENDINPUT);
+                // 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)
+                    inputBuffer.setSwallowInput(false);
                 inputBuffer.endRequest();
             } catch (IOException e) {
                 error = true;