camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject git commit: CAMEL-6611: Must close SSL on exception so client is notified asap.
Date Tue, 06 Aug 2013 13:38:05 GMT
Updated Branches:
  refs/heads/master 2d7051ed0 -> 717219295


CAMEL-6611: Must close SSL on exception so client is notified asap.


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

Branch: refs/heads/master
Commit: 717219295623787acba8853d3b28f9b51d809062
Parents: 2d7051e
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Tue Aug 6 15:34:10 2013 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue Aug 6 15:37:51 2013 +0200

----------------------------------------------------------------------
 .../component/netty/http/HttpClientPipelineFactory.java |  2 ++
 .../component/netty/http/HttpServerPipelineFactory.java | 12 ++++--------
 .../component/netty/http/NettyHttpConfiguration.java    |  9 ---------
 .../component/netty/DefaultClientPipelineFactory.java   |  2 ++
 .../component/netty/DefaultServerPipelineFactory.java   |  2 ++
 5 files changed, 10 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/71721929/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpClientPipelineFactory.java
----------------------------------------------------------------------
diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpClientPipelineFactory.java
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpClientPipelineFactory.java
index 9bc744d..14a63c8 100644
--- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpClientPipelineFactory.java
+++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpClientPipelineFactory.java
@@ -68,6 +68,8 @@ public class HttpClientPipelineFactory extends ClientPipelineFactory {
 
         SslHandler sslHandler = configureClientSSLOnDemand();
         if (sslHandler != null) {
+            // must close on SSL exception
+            sslHandler.setCloseOnSSLException(true);
             LOG.debug("Client SSL handler configured and added as an interceptor against
the ChannelPipeline: {}", sslHandler);
             pipeline.addLast("ssl", sslHandler);
         }

http://git-wip-us.apache.org/repos/asf/camel/blob/71721929/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpServerPipelineFactory.java
----------------------------------------------------------------------
diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpServerPipelineFactory.java
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpServerPipelineFactory.java
index 6eae81c..3d6444a 100644
--- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpServerPipelineFactory.java
+++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpServerPipelineFactory.java
@@ -76,15 +76,15 @@ public class HttpServerPipelineFactory extends ServerPipelineFactory {
 
         SslHandler sslHandler = configureServerSSLOnDemand(configuration);
         if (sslHandler != null) {
+            // must close on SSL exception
+            sslHandler.setCloseOnSSLException(true);
             LOG.debug("Server SSL handler configured and added as an interceptor against
the ChannelPipeline: {}", sslHandler);
             pipeline.addLast("ssl", sslHandler);
         }
 
         pipeline.addLast("decoder", new HttpRequestDecoder());
-        // Uncomment the following line if you don't want to handle HttpChunks.
-        if (supportChunked()) {
-            pipeline.addLast("aggregator", new HttpChunkAggregator(1048576));
-        }
+        pipeline.addLast("aggregator", new HttpChunkAggregator(1048576));
+
         pipeline.addLast("encoder", new HttpResponseEncoder());
         if (supportCompressed()) {
             pipeline.addLast("deflater", new HttpContentCompressor());
@@ -157,10 +157,6 @@ public class HttpServerPipelineFactory extends ServerPipelineFactory
{
         }
     }
 
-    private boolean supportChunked() {
-        return consumer.getEndpoint().getConfiguration().isChunked();
-    }
-
     private boolean supportCompressed() {
         return consumer.getEndpoint().getConfiguration().isCompression();
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/71721929/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
index e2360aa..94500e9 100644
--- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
+++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java
@@ -28,7 +28,6 @@ import org.jboss.netty.channel.ChannelHandler;
  */
 public class NettyHttpConfiguration extends NettyConfiguration {
 
-    private boolean chunked = true;
     private boolean urlDecodeHeaders = true;
     private boolean mapHeaders = true;
     private boolean compression;
@@ -63,14 +62,6 @@ public class NettyHttpConfiguration extends NettyConfiguration {
         }
     }
 
-    public boolean isChunked() {
-        return chunked;
-    }
-
-    public void setChunked(boolean chunked) {
-        this.chunked = chunked;
-    }
-
     public boolean isCompression() {
         return compression;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/71721929/components/camel-netty/src/main/java/org/apache/camel/component/netty/DefaultClientPipelineFactory.java
----------------------------------------------------------------------
diff --git a/components/camel-netty/src/main/java/org/apache/camel/component/netty/DefaultClientPipelineFactory.java
b/components/camel-netty/src/main/java/org/apache/camel/component/netty/DefaultClientPipelineFactory.java
index 9dc7e9c..28040d6 100644
--- a/components/camel-netty/src/main/java/org/apache/camel/component/netty/DefaultClientPipelineFactory.java
+++ b/components/camel-netty/src/main/java/org/apache/camel/component/netty/DefaultClientPipelineFactory.java
@@ -53,6 +53,8 @@ public class DefaultClientPipelineFactory extends ClientPipelineFactory
 {
 
         SslHandler sslHandler = configureClientSSLOnDemand();
         if (sslHandler != null) {
+            // must close on SSL exception
+            sslHandler.setCloseOnSSLException(true);
             LOG.debug("Client SSL handler configured and added to the ChannelPipeline: {}",
sslHandler);
             addToPipeline("ssl", channelPipeline, sslHandler);
         }

http://git-wip-us.apache.org/repos/asf/camel/blob/71721929/components/camel-netty/src/main/java/org/apache/camel/component/netty/DefaultServerPipelineFactory.java
----------------------------------------------------------------------
diff --git a/components/camel-netty/src/main/java/org/apache/camel/component/netty/DefaultServerPipelineFactory.java
b/components/camel-netty/src/main/java/org/apache/camel/component/netty/DefaultServerPipelineFactory.java
index 6ae04d0..99b3be9 100644
--- a/components/camel-netty/src/main/java/org/apache/camel/component/netty/DefaultServerPipelineFactory.java
+++ b/components/camel-netty/src/main/java/org/apache/camel/component/netty/DefaultServerPipelineFactory.java
@@ -69,6 +69,8 @@ public class DefaultServerPipelineFactory extends ServerPipelineFactory
{
 
         SslHandler sslHandler = configureServerSSLOnDemand();
         if (sslHandler != null) {
+            // must close on SSL exception
+            sslHandler.setCloseOnSSLException(true);
             LOG.debug("Server SSL handler configured and added as an interceptor against
the ChannelPipeline: {}", sslHandler);
             addToPipeline("ssl", channelPipeline, sslHandler);
         }


Mime
View raw message