cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject git commit: Require logging in for Thrift CQL2/3 statement preparation
Date Mon, 28 Oct 2013 13:22:18 GMT
Updated Branches:
  refs/heads/cassandra-1.2 cb506b793 -> 47896c888


Require logging in for Thrift CQL2/3 statement preparation

patch by Aleksey Yeschenko; reviewed by Sylvain Lebresne for
CASSANDRA-6254


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

Branch: refs/heads/cassandra-1.2
Commit: 47896c888b5cc51f5ad18739172bc4de6f1cdf5a
Parents: cb506b7
Author: Aleksey Yeschenko <aleksey@apache.org>
Authored: Mon Oct 28 16:20:35 2013 +0300
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Mon Oct 28 16:20:35 2013 +0300

----------------------------------------------------------------------
 CHANGES.txt                                             |  1 +
 .../org/apache/cassandra/thrift/CassandraServer.java    | 12 ++++++++----
 2 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/47896c88/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 63627e1..8d47047 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -5,6 +5,7 @@
  * add windows bat files for shell commands (CASSANDRA-6145)
  * Fix potential stack overflow during range tombstones insertion (CASSANDRA-6181)
  * (Hadoop) Make LOCAL_ONE the default consistency level (CASSANDRA-6214)
+ * Require logging in for Thrift CQL2/3 statement preparation (CASSANDRA-6254)
 
 
 1.2.11

http://git-wip-us.apache.org/repos/asf/cassandra/blob/47896c88/src/java/org/apache/cassandra/thrift/CassandraServer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/CassandraServer.java b/src/java/org/apache/cassandra/thrift/CassandraServer.java
index dbaabbb..9063be1 100644
--- a/src/java/org/apache/cassandra/thrift/CassandraServer.java
+++ b/src/java/org/apache/cassandra/thrift/CassandraServer.java
@@ -1731,10 +1731,12 @@ public class CassandraServer implements Cassandra.Iface
 
         validateCQLVersion(2);
 
+        String queryString = uncompress(query,compression);
+        ThriftClientState cState = state();
+
         try
         {
-            ThriftClientState cState = state();
-            String queryString = uncompress(query,compression);
+            cState.validateLogin();
             return QueryProcessor.prepare(queryString, cState);
         }
         catch (RequestValidationException e)
@@ -1751,10 +1753,12 @@ public class CassandraServer implements Cassandra.Iface
 
         validateCQLVersion(3);
 
+        String queryString = uncompress(query,compression);
+        ThriftClientState cState = state();
+
         try
         {
-            ThriftClientState cState = state();
-            String queryString = uncompress(query,compression);
+            cState.validateLogin();
             return org.apache.cassandra.cql3.QueryProcessor.prepare(queryString, cState,
true).toThriftPreparedResult();
         }
         catch (RequestValidationException e)


Mime
View raw message