Skip to content
This repository has been archived by the owner on May 25, 2021. It is now read-only.

Commit

Permalink
Merge pull request #124 from ssteo/master
Browse files Browse the repository at this point in the history
Fixed authentication issue and performance issue after authenticated
  • Loading branch information
nberardi committed Mar 20, 2013
2 parents 8c7bf03 + dcc948c commit 31f5ab3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/CassandraSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ internal CassandraClientWrapper GetClient(bool setKeyspace = true, bool? setCqlV
if (setCqlVersion.Value)
_connection.SetCqlVersion(builder.CqlVersion);

if (setLogin && !String.IsNullOrWhiteSpace(builder.Username) && !String.IsNullOrWhiteSpace(builder.Password))
if (!IsAuthenticated && setLogin && !String.IsNullOrWhiteSpace(builder.Username) && !String.IsNullOrWhiteSpace(builder.Password))
Login(builder.Username, builder.Password);

return new CassandraClientWrapper(_connection.Client);
Expand Down Expand Up @@ -149,7 +149,7 @@ public void Login(string username, string password)

try
{
GetClient(setLogin: false).login(auth);
GetClient(setKeyspace: false, setLogin: false).login(auth);
IsAuthenticated = true;
}
catch (Exception exc)
Expand Down

0 comments on commit 31f5ab3

Please sign in to comment.