tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kma...@apache.org
Subject svn commit: r673899 - /openejb/trunk/openejb3/server/openejb-http/src/main/java/org/apache/openejb/server/httpd/HttpResponseImpl.java
Date Fri, 04 Jul 2008 03:46:02 GMT
Author: kmalhi
Date: Thu Jul  3 20:46:02 2008
New Revision: 673899

URL: http://svn.apache.org/viewvc?rev=673899&view=rev
Log:
Fixed OPENEJB-843.
Http response was not being flushed fully causing the client to hang.
Fixed by flushing the response.
Thanks to Dain

Modified:
    openejb/trunk/openejb3/server/openejb-http/src/main/java/org/apache/openejb/server/httpd/HttpResponseImpl.java

Modified: openejb/trunk/openejb3/server/openejb-http/src/main/java/org/apache/openejb/server/httpd/HttpResponseImpl.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-http/src/main/java/org/apache/openejb/server/httpd/HttpResponseImpl.java?rev=673899&r1=673898&r2=673899&view=diff
==============================================================================
--- openejb/trunk/openejb3/server/openejb-http/src/main/java/org/apache/openejb/server/httpd/HttpResponseImpl.java
(original)
+++ openejb/trunk/openejb3/server/openejb-http/src/main/java/org/apache/openejb/server/httpd/HttpResponseImpl.java
Thu Jul  3 20:46:02 2008
@@ -202,7 +202,8 @@
      * @throws java.io.IOException if an exception is thrown
      */
     protected void writeMessage(OutputStream output) throws IOException{
-        DataOutput out = new DataOutputStream(output);
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+    	DataOutputStream out = new DataOutputStream(baos);
         //DataOutput log = new DataOutputStream(System.out);
         //System.out.println("\nRESPONSE");
         closeMessage();
@@ -212,6 +213,9 @@
         writeResponseLine(out);
         writeHeaders(out);
         writeBody(out);
+        out.flush();
+        output.write(baos.toByteArray());
+        output.flush();
     }
 
      /** initalizes the body */



Mime
View raw message