cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject [1/2] git commit: Do not open non-ssl storage port if encryption option is all patch by dbrosius reviewed by jbellis for cassandra-3916
Date Sat, 21 Sep 2013 03:36:12 GMT
Updated Branches:
  refs/heads/cassandra-2.0 0d976a8fb -> 15c738c58


Do not open non-ssl storage port if encryption option is all
patch by dbrosius reviewed by jbellis for cassandra-3916


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

Branch: refs/heads/cassandra-2.0
Commit: fb43309b4741372f777e8ce910cd496299a1ebbf
Parents: a0fa697
Author: Dave Brosius <dbrosius@apache.org>
Authored: Fri Sep 20 23:24:10 2013 -0400
Committer: Dave Brosius <dbrosius@apache.org>
Committed: Fri Sep 20 23:24:10 2013 -0400

----------------------------------------------------------------------
 CHANGES.txt                                     |  2 +
 .../apache/cassandra/net/MessagingService.java  | 75 ++++++++++----------
 2 files changed, 41 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/fb43309b/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 27e6f24..b4681ae 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,7 @@
 1.2.11
  * Allow cache-keys-to-save to be set at runtime (CASSANDRA-5980)
+ * Allow where clause conditions to be in parenthesis (CASSANDRA-6037)
+ * Do not open non-ssl storage port if encryption option is all (CASSANDRA-3916)
 
 
 1.2.10

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fb43309b/src/java/org/apache/cassandra/net/MessagingService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/net/MessagingService.java b/src/java/org/apache/cassandra/net/MessagingService.java
index 2964d35..a199e83 100644
--- a/src/java/org/apache/cassandra/net/MessagingService.java
+++ b/src/java/org/apache/cassandra/net/MessagingService.java
@@ -413,45 +413,48 @@ public final class MessagingService implements MessagingServiceMBean
             logger.info("Starting Encrypted Messaging Service on SSL port {}", DatabaseDescriptor.getSSLStoragePort());
         }
 
-        ServerSocketChannel serverChannel = null;
-        try
-        {
-            serverChannel = ServerSocketChannel.open();
-        }
-        catch (IOException e)
-        {
-            throw new RuntimeException(e);
-        }
-        ServerSocket socket = serverChannel.socket();
-        try
-        {
-            socket.setReuseAddress(true);
-        }
-        catch (SocketException e)
+        if (DatabaseDescriptor.getServerEncryptionOptions().internode_encryption != ServerEncryptionOptions.InternodeEncryption.all)
         {
-            throw new ConfigurationException("Insufficient permissions to setReuseAddress",
e);
-        }
-        InetSocketAddress address = new InetSocketAddress(localEp, DatabaseDescriptor.getStoragePort());
-        try
-        {
-            socket.bind(address);
-        }
-        catch (BindException e)
-        {
-            if (e.getMessage().contains("in use"))
-                throw new ConfigurationException(address + " is in use by another process.
 Change listen_address:storage_port in cassandra.yaml to values that do not conflict with
other services");
-            else if (e.getMessage().contains("Cannot assign requested address"))
-                throw new ConfigurationException("Unable to bind to address " + address
-                                                 + ". Set listen_address in cassandra.yaml
to an interface you can bind to, e.g., your private IP address on EC2");
-            else
+            ServerSocketChannel serverChannel = null;
+            try
+            {
+                serverChannel = ServerSocketChannel.open();
+            }
+            catch (IOException e)
+            {
                 throw new RuntimeException(e);
+            }
+            ServerSocket socket = serverChannel.socket();
+            try
+            {
+                socket.setReuseAddress(true);
+            }
+            catch (SocketException e)
+            {
+                throw new ConfigurationException("Insufficient permissions to setReuseAddress",
e);
+            }
+            InetSocketAddress address = new InetSocketAddress(localEp, DatabaseDescriptor.getStoragePort());
+            try
+            {
+                socket.bind(address);
+            }
+            catch (BindException e)
+            {
+                if (e.getMessage().contains("in use"))
+                    throw new ConfigurationException(address + " is in use by another process.
 Change listen_address:storage_port in cassandra.yaml to values that do not conflict with
other services");
+                else if (e.getMessage().contains("Cannot assign requested address"))
+                    throw new ConfigurationException("Unable to bind to address " + address
+                                                     + ". Set listen_address in cassandra.yaml
to an interface you can bind to, e.g., your private IP address on EC2");
+                else
+                    throw new RuntimeException(e);
+            }
+            catch (IOException e)
+            {
+                throw new RuntimeException(e);
+            }
+            logger.info("Starting Messaging Service on port {}", DatabaseDescriptor.getStoragePort());
+            ss.add(socket);
         }
-        catch (IOException e)
-        {
-            throw new RuntimeException(e);
-        }
-        logger.info("Starting Messaging Service on port {}", DatabaseDescriptor.getStoragePort());
-        ss.add(socket);
         return ss;
     }
 


Mime
View raw message