Repository: camel
Updated Branches:
  refs/heads/master be73f1aa8 -> c5254616b


CAMEL-8821 merged the patch into camel-http4


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c5254616
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c5254616
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c5254616

Branch: refs/heads/master
Commit: c5254616bd76547b74257500069a95b560d8db61
Parents: 23a07e5
Author: Willem Jiang <willem.ji...@gmail.com>
Authored: Sun May 31 11:10:58 2015 +0800
Committer: Willem Jiang <willem.ji...@gmail.com>
Committed: Sun May 31 11:11:26 2015 +0800

----------------------------------------------------------------------
 .../camel/component/http4/DefaultHttpBinding.java       |  2 +-
 .../apache/camel/component/http4/helper/HttpHelper.java | 12 ++++++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/c5254616/components/camel-http4/src/main/java/org/apache/camel/component/http4/DefaultHttpBinding.java
----------------------------------------------------------------------
diff --git 
a/components/camel-http4/src/main/java/org/apache/camel/component/http4/DefaultHttpBinding.java
 
b/components/camel-http4/src/main/java/org/apache/camel/component/http4/DefaultHttpBinding.java
index f94a3c1..c7a9e2c 100644
--- 
a/components/camel-http4/src/main/java/org/apache/camel/component/http4/DefaultHttpBinding.java
+++ 
b/components/camel-http4/src/main/java/org/apache/camel/component/http4/DefaultHttpBinding.java
@@ -420,7 +420,7 @@ public class DefaultHttpBinding implements HttpBinding {
                     return null;
                 }
             }
-            // reade the response body from servlet request
+            // read the response body from servlet request
             return HttpHelper.readResponseBodyFromServletRequest(request, 
httpMessage.getExchange());
         }
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/c5254616/components/camel-http4/src/main/java/org/apache/camel/component/http4/helper/HttpHelper.java
----------------------------------------------------------------------
diff --git 
a/components/camel-http4/src/main/java/org/apache/camel/component/http4/helper/HttpHelper.java
 
b/components/camel-http4/src/main/java/org/apache/camel/component/http4/helper/HttpHelper.java
index 82c4fd9..4201ed9 100644
--- 
a/components/camel-http4/src/main/java/org/apache/camel/component/http4/helper/HttpHelper.java
+++ 
b/components/camel-http4/src/main/java/org/apache/camel/component/http4/helper/HttpHelper.java
@@ -41,6 +41,7 @@ import org.apache.camel.component.http4.HttpMessage;
 import org.apache.camel.component.http4.HttpMethods;
 import org.apache.camel.component.http4.HttpServletUrlRewrite;
 import org.apache.camel.converter.stream.CachedOutputStream;
+import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.util.CamelObjectInputStream;
 import org.apache.camel.util.IOHelper;
 import org.apache.camel.util.ObjectHelper;
@@ -163,9 +164,16 @@ public final class HttpHelper {
         if (is == null) {
             return null;
         }
-
+        
+        boolean disableStreamCaching = false;
+        // Just take the consideration of the setting of Camel Context 
StreamCaching
+        if (exchange.getContext() instanceof DefaultCamelContext) { 
+            DefaultCamelContext context = (DefaultCamelContext) 
exchange.getContext();
+            disableStreamCaching = !context.isStreamCaching();
+        }
+        
         // convert the input stream to StreamCache if the stream cache is not 
disabled
-        if (exchange.getProperty(Exchange.DISABLE_HTTP_STREAM_CACHE, 
Boolean.FALSE, Boolean.class)) {
+        if (exchange.getProperty(Exchange.DISABLE_HTTP_STREAM_CACHE, 
disableStreamCaching, Boolean.class)) {
             return is;
         } else {
             CachedOutputStream cos = new CachedOutputStream(exchange);

Reply via email to