summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qmf/Agent.cpp15
-rw-r--r--qpid/cpp/src/qmf/ConsoleSession.cpp2
-rw-r--r--qpid/cpp/src/qmf/ConsoleSessionImpl.h1
3 files changed, 10 insertions, 8 deletions
diff --git a/qpid/cpp/src/qmf/Agent.cpp b/qpid/cpp/src/qmf/Agent.cpp
index 3843053905..915f2a1c88 100644
--- a/qpid/cpp/src/qmf/Agent.cpp
+++ b/qpid/cpp/src/qmf/Agent.cpp
@@ -556,8 +556,9 @@ void AgentImpl::sendQuery(const Query& query, uint32_t correlator)
msg.setReplyTo(session.replyAddress);
msg.setCorrelationId(boost::lexical_cast<string>(correlator));
msg.setSubject(directSubject);
- if (!session.authUser.empty())
- msg.setUserId(session.authUser);
+ string userId(session.connection.getAuthenticatedUsername());
+ if (!userId.empty())
+ msg.setUserId(userId);
encode(QueryImplAccess::get(query).asMap(), msg);
if (sender.isValid()) {
sender.send(msg);
@@ -583,8 +584,9 @@ void AgentImpl::sendMethod(const string& method, const Variant::Map& args, const
msg.setReplyTo(session.replyAddress);
msg.setCorrelationId(boost::lexical_cast<string>(correlator));
msg.setSubject(directSubject);
- if (!session.authUser.empty())
- msg.setUserId(session.authUser);
+ string userId(session.connection.getAuthenticatedUsername());
+ if (!userId.empty())
+ msg.setUserId(userId);
encode(map, msg);
if (sender.isValid()) {
sender.send(msg);
@@ -626,8 +628,9 @@ void AgentImpl::sendSchemaRequest(const SchemaId& id)
msg.setReplyTo(session.replyAddress);
msg.setContent(content);
msg.setSubject(directSubject);
- if (!session.authUser.empty())
- msg.setUserId(session.authUser);
+ string userId(session.connection.getAuthenticatedUsername());
+ if (!userId.empty())
+ msg.setUserId(userId);
if (sender.isValid()) {
sender.send(msg);
QPID_LOG(trace, "SENT V1SchemaRequest to=" << sender.getName() << "/" << directSubject);
diff --git a/qpid/cpp/src/qmf/ConsoleSession.cpp b/qpid/cpp/src/qmf/ConsoleSession.cpp
index f85b618891..e12c1152f6 100644
--- a/qpid/cpp/src/qmf/ConsoleSession.cpp
+++ b/qpid/cpp/src/qmf/ConsoleSession.cpp
@@ -65,7 +65,7 @@ Subscription ConsoleSession::subscribe(const string& q, const string& f, const s
//========================================================================================
ConsoleSessionImpl::ConsoleSessionImpl(Connection& c, const string& options) :
- connection(c), domain("default"), authUser(c.getAuthenticatedUsername()), maxAgentAgeMinutes(5),
+ connection(c), domain("default"), maxAgentAgeMinutes(5),
opened(false), thread(0), threadCanceled(false), lastVisit(0), lastAgePass(0),
connectedBrokerInAgentList(false), schemaCache(new SchemaCache())
{
diff --git a/qpid/cpp/src/qmf/ConsoleSessionImpl.h b/qpid/cpp/src/qmf/ConsoleSessionImpl.h
index e495c1c1e8..675c8bcfb5 100644
--- a/qpid/cpp/src/qmf/ConsoleSessionImpl.h
+++ b/qpid/cpp/src/qmf/ConsoleSessionImpl.h
@@ -72,7 +72,6 @@ namespace qmf {
qpid::messaging::Sender directSender;
qpid::messaging::Sender topicSender;
std::string domain;
- std::string authUser;
uint32_t maxAgentAgeMinutes;
bool listenOnDirect;
bool strictSecurity;