From: billbarker Date: Sat, 15 Nov 2008 02:30:12 +0000 (+0000) Subject: If we know we are closing the connection, don't drain input. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f54d45259c203bc44ed345175fb7d8961ec5f593;p=tomcat7.0 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. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@714214 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/coyote/http11/Http11AprProcessor.java b/java/org/apache/coyote/http11/Http11AprProcessor.java index b1908acbd..fae37f977 100644 --- a/java/org/apache/coyote/http11/Http11AprProcessor.java +++ b/java/org/apache/coyote/http11/Http11AprProcessor.java @@ -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(); } diff --git a/java/org/apache/coyote/http11/Http11NioProcessor.java b/java/org/apache/coyote/http11/Http11NioProcessor.java index 521433616..70a4784ab 100644 --- a/java/org/apache/coyote/http11/Http11NioProcessor.java +++ b/java/org/apache/coyote/http11/Http11NioProcessor.java @@ -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(); } diff --git a/java/org/apache/coyote/http11/Http11Processor.java b/java/org/apache/coyote/http11/Http11Processor.java index 03f8c2413..812eef7cd 100644 --- a/java/org/apache/coyote/http11/Http11Processor.java +++ b/java/org/apache/coyote/http11/Http11Processor.java @@ -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;