Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 48e8dcc8f -> 20bc92463
  refs/heads/trunk 516e232c3 -> 189d51f04


Ninja: don't close the connection you don't own (after SOURCE command)


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

Branch: refs/heads/cassandra-2.1
Commit: 20bc92463a59699ee31b766440820123d5ba5e2b
Parents: 48e8dcc
Author: Mikhail Stepura <[email protected]>
Authored: Thu Mar 27 11:56:32 2014 -0700
Committer: Mikhail Stepura <[email protected]>
Committed: Thu Mar 27 11:56:32 2014 -0700

----------------------------------------------------------------------
 bin/cqlsh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/20bc9246/bin/cqlsh
----------------------------------------------------------------------
diff --git a/bin/cqlsh b/bin/cqlsh
index aa19c4d..d7025cf 100755
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@ -480,6 +480,7 @@ class Shell(cmd.Cmd):
                                 auth_provider=self.auth_provider,
                                 ssl_options=sslhandling.ssl_settings(hostname, 
CONFIG_FILE) if ssl else None,
                                 
load_balancing_policy=WhiteListRoundRobinPolicy([self.hostname]))
+        self.owns_connection = not use_conn
         self.set_expanded_cql_version(cqlver)
 
         if keyspace:
@@ -1624,7 +1625,8 @@ class Shell(cmd.Cmd):
         Exits cqlsh.
         """
         self.stop = True
-        self.conn.shutdown()
+        if self.owns_connection:
+            self.conn.shutdown()
     do_quit = do_exit
 
     def do_debug(self, parsed):

Reply via email to