From df826cf6ab76c434904811eb38c2258c278d7872 Mon Sep 17 00:00:00 2001 From: Ted Ross Date: Tue, 22 Sep 2009 18:58:59 +0000 Subject: 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 --- cpp/src/qpid/client/ConnectionImpl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cpp/src/qpid/client/ConnectionImpl.cpp') 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 = handler.getSecurityLayer(); if (securityLayer.get()) { -- cgit v1.2.1