You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ve...@apache.org on 2009/10/10 23:54:19 UTC

svn commit: r823960 - /webservices/axis2/trunk/java/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java

Author: veithen
Date: Sat Oct 10 21:54:18 2009
New Revision: 823960

URL: http://svn.apache.org/viewvc?rev=823960&view=rev
Log:
AxisServlet wraps the ServletOutputStream in a BufferedOutputStream but doesn't care to flush the BufferedOutputStream, and thus relies on the message formatter to do so. This however is not a requirement specified by the MessageFormatter interface and is also a difference with respect to other transports that manage the output stream properly.

This patch changes AxisServlet to properly flush any buffered data and solves the issue described in [1].

[1] http://markmail.org/message/dcmi7x4uu5ox6zlp

Modified:
    webservices/axis2/trunk/java/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java

Modified: webservices/axis2/trunk/java/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java?rev=823960&r1=823959&r2=823960&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java (original)
+++ webservices/axis2/trunk/java/modules/transport/http/src/org/apache/axis2/transport/http/AxisServlet.java Sat Oct 10 21:54:18 2009
@@ -150,10 +150,12 @@
                     url = request.getRequestURI();
                 }
                 
+                OutputStream bufferedOut = new BufferedOutputStream(out);
+                
                 InvocationResponse pi = HTTPTransportUtils.
                         processHTTPPostRequest(msgContext,
                                 new BufferedInputStream(request.getInputStream()),
-                                new BufferedOutputStream(out),
+                                bufferedOut,
                                 contentType,
                                 request.getHeader(HTTPConstants.HEADER_SOAP_ACTION),
                                 url);
@@ -179,6 +181,10 @@
                 						RequestResponseTransportStatus.SIGNALLED)) {
                     response.setStatus(HttpServletResponse.SC_ACCEPTED);
                 }
+                
+                // Make sure that no data remains in the BufferedOutputStream even if the message
+                // formatter doesn't call flush
+                bufferedOut.flush();
 
             } catch (AxisFault e) {
                 setResponseState(msgContext, response);