Author: markt
Date: Mon Mar 14 11:43:28 2011
New Revision: 1081338

URL: http://svn.apache.org/viewvc?rev=1081338&view=rev
Log:
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.

Modified:
    tomcat/tc5.5.x/trunk/STATUS.txt
    
tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/connector/OutputBuffer.java
    tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml

Modified: tomcat/tc5.5.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/STATUS.txt?rev=1081338&r1=1081337&r2=1081338&view=diff
==============================================================================
--- tomcat/tc5.5.x/trunk/STATUS.txt (original)
+++ tomcat/tc5.5.x/trunk/STATUS.txt Mon Mar 14 11:43:28 2011
@@ -45,14 +45,6 @@ PATCHES PROPOSED TO BACKPORT:
   +1: markt, kfujino
   -1:
 
-* 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.
-  http://svn.apache.org/viewvc?rev=1072042&view=rev
-  +1: markt, mturk, kkolinko
-  -1:
-
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=28852
   Add URL encoding where missing to parameters in URLs presented by Ant tasks 
to
   the Manager application.

Modified: 
tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/connector/OutputBuffer.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/connector/OutputBuffer.java?rev=1081338&r1=1081337&r2=1081338&view=diff
==============================================================================
--- 
tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/connector/OutputBuffer.java
 (original)
+++ 
tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/connector/OutputBuffer.java
 Mon Mar 14 11:43:28 2011
@@ -280,6 +280,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();
 
     }

Modified: tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml?rev=1081338&r1=1081337&r2=1081338&view=diff
==============================================================================
--- tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml (original)
+++ tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml Mon Mar 14 
11:43:28 2011
@@ -40,7 +40,15 @@
  General, Catalina, Coyote, Jasper, Cluster, Webapps
 -->
 <section name="Tomcat 5.5.34 (jim)" rtext="">
-
+  <subsection name="Catalina">
+    <changelog>
+      <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>
+    </changelog>
+  </subsection>
 </section>
 <section name="Tomcat 5.5.33 (jim)" rtext="released 2011-02-10">
   <subsection name="General">



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to