Author: markt Date: Thu Feb 7 11:57:55 2013 New Revision: 1443430 URL: http://svn.apache.org/viewvc?rev=1443430&view=rev Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54456 If the client aborts the request, make sure this is communicated to the application reading the request body.
Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc7.0.x/trunk/ ------------------------------------------------------------------------------ Merged /tomcat/trunk:r1443427 Modified: tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java?rev=1443430&r1=1443429&r2=1443430&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java Thu Feb 7 11:57:55 2013 @@ -160,7 +160,10 @@ public class ChunkedInputFilter implemen int result = 0; if (pos >= lastValid) { - readBytes(); + if (readBytes() < 0) { + throw new IOException( + "Unexpected end of stream whilst reading request body"); + } } if (remaining > (lastValid - pos)) { @@ -398,7 +401,7 @@ public class ChunkedInputFilter implemen */ protected void parseEndChunk() throws IOException { - // Handle option trailer headers + // Handle optional trailer headers while (parseHeader()) { // Loop until we run out of headers } Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1443430&r1=1443429&r2=1443430&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Thu Feb 7 11:57:55 2013 @@ -67,6 +67,15 @@ </fix> </changelog> </subsection> + <subsection name="Coyote"> + <changelog> + <fix> + <bug>54456</bug>: Ensure that if a client aborts a request when sending + a chunked request body that this is communicated correctly to the client + reading the request body. (markt) + </fix> + </changelog> + </subsection> </section> <section name="Tomcat 7.0.36 (markt)" rtext="not released"> <subsection name="Catalina"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org