summaryrefslogtreecommitdiff
path: root/cpp/src
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
commit2baf0393eb97613af60c34b068d211172b206737 (patch)
treefb40a26ba5c8960b943c4e4fbc32c1d7298800c8 /cpp/src
parent1a21c038048310cb95f15f47cfd9eaabc1d1f2f3 (diff)
downloadqpid-python-2baf0393eb97613af60c34b068d211172b206737.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/qpid@1089294 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/SaslFactory.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/cpp/src/qpid/SaslFactory.cpp b/cpp/src/qpid/SaslFactory.cpp
index 055883abee..f117404028 100644
--- a/cpp/src/qpid/SaslFactory.cpp
+++ b/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;