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

Specifying username / password causes infinite recursion in CassandraSession.cs #110

Closed
clamanna opened this issue Jan 26, 2013 · 2 comments

Comments

@clamanna
Copy link
Contributor

Which results in a stack overflow if you provide the username / password:

The login calls GetClient() which then calls Login() and voila, infinite recursion.

    public void Login(string username, string password)
    {
        var auth = new AuthenticationRequest {
            Credentials = new Dictionary<string, string> { { "username", username }, { "password", password } }
        };

        try
        {
            GetClient().login(auth);
            IsAuthenticated = true;
        }
        catch (Exception exc)
        {
            IsAuthenticated = false;
            throw new CassandraException("Login failed.", exc);
        }
    }
@clamanna
Copy link
Contributor Author

I will send a pull request later today

@nberardi
Copy link
Contributor

Great and thank you.

On Mon, Jan 28, 2013 at 2:47 PM, Charles Lamanna
notifications@github.comwrote:

I will send a pull request later today


Reply to this email directly or view it on GitHubhttps://github.com//issues/110#issuecomment-12800410.

clamanna added a commit to clamanna/fluentcassandra that referenced this issue Jan 28, 2013
…code path

GetClient / Login have a cyclic dependency. When we fetch the client, we
do not always want to Login -- as a result, add a boolean flag to
indicate whether or not a login is required.
nberardi added a commit that referenced this issue Jan 29, 2013
Fix Issue #110 -- Prevent infinite recursion in login code path
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants