summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Goulish <mgoulish@apache.org>2011-04-06 04:39:40 +0000
committerMichael Goulish <mgoulish@apache.org>2011-04-06 04:39:40 +0000
commit4f0dc67c3b08325cbbb0898c0100a48eba8a68a3 (patch)
treeb245a69e5cad0157a5c1249253e11328c0b37126
parentd07efc2dc34bae9a5fb99655d38cea23b0cff2bb (diff)
downloadqpid-python-4f0dc67c3b08325cbbb0898c0100a48eba8a68a3.tar.gz
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
-rw-r--r--qpid/cpp/src/qpid/SaslFactory.cpp17
1 files changed, 9 insertions, 8 deletions
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;