Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50189
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 18 Feb 2011 16:24:36 +0000 (16:24 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 18 Feb 2011 16:24:36 +0000 (16:24 +0000)
Once the application has finished writing to the response, prevent further reads from the request since this causes various problems in the connectors which do not expect this.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1072042 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/connector/OutputBuffer.java
webapps/docs/changelog.xml

index e9bfc2c..7ab8d26 100644 (file)
@@ -275,6 +275,13 @@ public class OutputBuffer extends Writer
         doFlush(false);
         closed = true;
 
+        // The request should have been completely read by the time the response
+        // is closed. Further reads of the input a) are pointless and b) really
+        // confuse AJP (bug 50189) so close the input buffer to prevent them.
+        Request req = (Request) coyoteResponse.getRequest().getNote(
+                CoyoteAdapter.ADAPTER_NOTES);
+        req.inputBuffer.close();
+        
         coyoteResponse.finish();
 
     }
index 4374166..6ffb8ef 100644 (file)
         the expected state transitions. (markt)
       </add>
       <fix>
+        <bug>50189</bug>: Once the application has finished writing to the
+        response, prevent further reads from the request since this causes
+        various problems in the connectors which do not expect this. (markt)
+      </fix>
+      <fix>
         <bug>50700</bug>: Ensure that the override attribute of context
         parameters is correctly followed. (markt)
       </fix>