You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2010/07/14 14:03:22 UTC

svn commit: r964018 - /camel/trunk/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java

Author: ningjiang
Date: Wed Jul 14 12:03:22 2010
New Revision: 964018

URL: http://svn.apache.org/viewvc?rev=964018&view=rev
Log:
CAMEL-2947 also update the code of http4

Modified:
    camel/trunk/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java

Modified: camel/trunk/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java?rev=964018&r1=964017&r2=964018&view=diff
==============================================================================
--- camel/trunk/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java (original)
+++ camel/trunk/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java Wed Jul 14 12:03:22 2010
@@ -229,9 +229,11 @@ public class HttpProducer extends Defaul
         // As httpclient is using a AutoCloseInputStream, it will be closed when the connection is closed
         // we need to cache the stream for it.
         try {
-            CachedOutputStream cos = new CachedOutputStream(exchange);
+            // This CachedOutputStream will not be closed when the exchange is onCompletion
+            CachedOutputStream cos = new CachedOutputStream(exchange, false);
             IOHelper.copy(is, cos);
-            return cos.getInputStream();
+            // When the InputStream is closed, the CachedOutputStream will be closed
+            return cos.getWrappedInputStream();
         } finally {
             IOHelper.close(is, "Extracting response body", LOG);
         }