From 4f0dc67c3b08325cbbb0898c0100a48eba8a68a3 Mon Sep 17 00:00:00 2001 From: Michael Goulish Date: Wed, 6 Apr 2011 04:39:40 +0000 Subject: gsim's patch to bring c++ logic in line with other clients. If there is no username, then do nothing with either NAME or PASSWD callbacks. If there is a name but no passwd, then explicitly store an empty PASSWD callback. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1089294 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/qpid/SaslFactory.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'qpid/cpp') diff --git a/qpid/cpp/src/qpid/SaslFactory.cpp b/qpid/cpp/src/qpid/SaslFactory.cpp index 055883abee..f117404028 100644 --- a/qpid/cpp/src/qpid/SaslFactory.cpp +++ b/qpid/cpp/src/qpid/SaslFactory.cpp @@ -182,17 +182,18 @@ CyrusSasl::CyrusSasl(const std::string & username, const std::string & password, callbacks[i].id = SASL_CB_AUTHNAME; callbacks[i].proc = (CallbackProc*) &getUserFromSettings; callbacks[i++].context = &settings; - } - callbacks[i].id = SASL_CB_PASS; - if (settings.password.empty()) { - callbacks[i].proc = 0; - callbacks[i++].context = 0; - } else { - callbacks[i].proc = (CallbackProc*) &getPasswordFromSettings; - callbacks[i++].context = &settings; + callbacks[i].id = SASL_CB_PASS; + if (settings.password.empty()) { + callbacks[i].proc = 0; + callbacks[i++].context = 0; + } else { + callbacks[i].proc = (CallbackProc*) &getPasswordFromSettings; + callbacks[i++].context = &settings; + } } + callbacks[i].id = SASL_CB_LIST_END; callbacks[i].proc = 0; callbacks[i++].context = 0; -- cgit v1.2.1