summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client/ConnectionImpl.cpp
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2009-09-22 18:58:59 +0000
committerTed Ross <tross@apache.org>2009-09-22 18:58:59 +0000
commitdf826cf6ab76c434904811eb38c2258c278d7872 (patch)
treee922dd983bd06439ed211ff085007774ec016f7e /cpp/src/qpid/client/ConnectionImpl.cpp
parent3c1145e1d9fe5499f305e076e6ab48413e272d9a (diff)
downloadqpid-python-df826cf6ab76c434904811eb38c2258c278d7872.tar.gz
QPID-2112 - C++ Client: Facility needed for app to extract the user-ID in use for a connection
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@817770 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/ConnectionImpl.cpp')
-rw-r--r--cpp/src/qpid/client/ConnectionImpl.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/cpp/src/qpid/client/ConnectionImpl.cpp b/cpp/src/qpid/client/ConnectionImpl.cpp
index 45ad819ebd..c56d6a6807 100644
--- a/cpp/src/qpid/client/ConnectionImpl.cpp
+++ b/cpp/src/qpid/client/ConnectionImpl.cpp
@@ -151,6 +151,12 @@ void ConnectionImpl::open()
handler.waitForOpen();
+ // If the SASL layer has provided an "operational" userId for the connection,
+ // put it in the negotiated settings.
+ const std::string& userId(handler.getUserId());
+ if (!userId.empty())
+ handler.username = userId;
+
//enable security layer if one has been negotiated:
std::auto_ptr<SecurityLayer> securityLayer = handler.getSecurityLayer();
if (securityLayer.get()) {