You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2015/01/22 12:54:49 UTC

svn commit: r1653816 - /tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java

Author: markt
Date: Thu Jan 22 11:54:49 2015
New Revision: 1653816

URL: http://svn.apache.org/r1653816
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=57476
As per section 9.4 of the Servlet spec, ensure that the response body has been completely written before exiting the forward method.

Modified:
    tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java?rev=1653816&r1=1653815&r2=1653816&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java Thu Jan 22 11:54:49 2015
@@ -402,6 +402,7 @@ final class ApplicationDispatcher implem
             wrapper.getLogger().debug(" Disabling the response for futher output");
 
         if  (response instanceof ResponseFacade) {
+            response.flushBuffer();
             ((ResponseFacade) response).finish();
         } else {
             // Servlet SRV.6.2.2. The Request/Response may have been wrapped



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


Re: svn commit: r1653816 - /tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java

Posted by Mark Thomas <ma...@apache.org>.
On 22/01/2015 12:07, Rémy Maucherat wrote:
> 2015-01-22 12:54 GMT+01:00 <ma...@apache.org>:
> 
>> Author: markt
>> Date: Thu Jan 22 11:54:49 2015
>> New Revision: 1653816
>>
>> URL: http://svn.apache.org/r1653816
>> Log:
>> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=57476
>> As per section 9.4 of the Servlet spec, ensure that the response body has
>> been completely written before exiting the forward method.
>>
> I did suspect r1643210 but couldn't see the problem. However, although the
> spec language about flushing is there, this could be wrong in the context
> of Tomcat: no error pages, chunking only, etc. That's why the "suspend"
> thing was added: pretend everything is done but leave it there for
> postprocessing.

Good points. I also haven't completed a full unit test run yet either
and that might highlight further issues along the same lines.

I'll see about a better fix.


Mark

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


Re: svn commit: r1653816 - /tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java

Posted by Rémy Maucherat <re...@apache.org>.
2015-01-22 12:54 GMT+01:00 <ma...@apache.org>:

> Author: markt
> Date: Thu Jan 22 11:54:49 2015
> New Revision: 1653816
>
> URL: http://svn.apache.org/r1653816
> Log:
> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=57476
> As per section 9.4 of the Servlet spec, ensure that the response body has
> been completely written before exiting the forward method.
>
> I did suspect r1643210 but couldn't see the problem. However, although the
spec language about flushing is there, this could be wrong in the context
of Tomcat: no error pages, chunking only, etc. That's why the "suspend"
thing was added: pretend everything is done but leave it there for
postprocessing.

Rémy