From 355662f3efe2ab282f65cbf83efaf9d8fe4c8da2 Mon Sep 17 00:00:00 2001 From: markt Date: Fri, 18 Feb 2011 16:24:36 +0000 Subject: [PATCH] Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50189 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 | 7 +++++++ webapps/docs/changelog.xml | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/java/org/apache/catalina/connector/OutputBuffer.java b/java/org/apache/catalina/connector/OutputBuffer.java index e9bfc2c20..7ab8d2602 100644 --- a/java/org/apache/catalina/connector/OutputBuffer.java +++ b/java/org/apache/catalina/connector/OutputBuffer.java @@ -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(); } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 437416648..6ffb8ef0e 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -64,6 +64,11 @@ the expected state transitions. (markt) + 50189: 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) + + 50700: Ensure that the override attribute of context parameters is correctly followed. (markt) -- 2.11.0