diff options
| author | Gordon Sim <gsim@apache.org> | 2011-10-12 06:16:44 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2011-10-12 06:16:44 +0000 |
| commit | 4e3d69b833cab44630dc79f60aa5b84b4801251d (patch) | |
| tree | 4f549bb566572c7e80ae97a164edc056077648d1 /cpp/src/qpid/client/ConnectionHandler.cpp | |
| parent | 8ca12231174b85274d5f79d8dd0fc0ea949906be (diff) | |
| download | qpid-python-4e3d69b833cab44630dc79f60aa5b84b4801251d.tar.gz | |
QPID-3522: Distinguish between null and empty string for sasl response
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1182212 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/ConnectionHandler.cpp')
| -rw-r--r-- | cpp/src/qpid/client/ConnectionHandler.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/cpp/src/qpid/client/ConnectionHandler.cpp b/cpp/src/qpid/client/ConnectionHandler.cpp index 801fe38051..ab0d8e0700 100644 --- a/cpp/src/qpid/client/ConnectionHandler.cpp +++ b/cpp/src/qpid/client/ConnectionHandler.cpp @@ -254,8 +254,18 @@ void ConnectionHandler::start(const FieldTable& /*serverProps*/, const Array& me } if (sasl.get()) { - string response = sasl->start(join(mechlist), getSecuritySettings ? getSecuritySettings() : 0); - proxy.startOk(properties, sasl->getMechanism(), response, locale); + string response; + if (sasl->start(join(mechlist), response, getSecuritySettings ? getSecuritySettings() : 0)) { + proxy.startOk(properties, sasl->getMechanism(), response, locale); + } else { + //response was null + ConnectionStartOkBody body; + body.setClientProperties(properties); + body.setMechanism(sasl->getMechanism()); + //Don't set response, as none was given + body.setLocale(locale); + proxy.send(body); + } } else { //TODO: verify that desired mechanism and locale are supported string response = ((char)0) + username + ((char)0) + password; |
