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.cpp10
-rw-r--r--qpid/cpp/src/qmf/ConsoleSession.cpp6
-rw-r--r--qpid/cpp/src/qmf/ConsoleSessionImpl.h1
3 files changed, 13 insertions, 4 deletions
diff --git a/qpid/cpp/src/qmf/Agent.cpp b/qpid/cpp/src/qmf/Agent.cpp
index 1b7d03968e..8783cfa832 100644
--- a/qpid/cpp/src/qmf/Agent.cpp
+++ b/qpid/cpp/src/qmf/Agent.cpp
@@ -119,7 +119,9 @@ ConsoleEvent AgentImpl::query(const Query& query, Duration timeout)
context->cond.wait(context->lock,
qpid::sys::AbsTime(qpid::sys::now(),
qpid::sys::Duration(milliseconds * qpid::sys::TIME_MSEC)));
- if (context->response.isValid() && context->response.isFinal())
+ if (context->response.isValid() &&
+ ((context->response.getType() == CONSOLE_QUERY_RESPONSE && context->response.isFinal()) ||
+ (context->response.getType() == CONSOLE_EXCEPTION)))
result = context->response;
else {
auto_ptr<ConsoleEventImpl> impl(new ConsoleEventImpl(CONSOLE_EXCEPTION));
@@ -520,6 +522,8 @@ 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);
encode(QueryImplAccess::get(query).asMap(), msg);
if (sender.isValid())
sender.send(msg);
@@ -545,6 +549,8 @@ 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);
encode(map, msg);
if (sender.isValid())
sender.send(msg);
@@ -586,6 +592,8 @@ void AgentImpl::sendSchemaRequest(const SchemaId& id)
msg.setReplyTo(session.replyAddress);
msg.setContent(content);
msg.setSubject(directSubject);
+ if (!session.authUser.empty())
+ msg.setUserId(session.authUser);
if (sender.isValid())
sender.send(msg);
diff --git a/qpid/cpp/src/qmf/ConsoleSession.cpp b/qpid/cpp/src/qmf/ConsoleSession.cpp
index 4556c6ab94..bb4458a0b9 100644
--- a/qpid/cpp/src/qmf/ConsoleSession.cpp
+++ b/qpid/cpp/src/qmf/ConsoleSession.cpp
@@ -65,9 +65,9 @@ Subscription ConsoleSession::subscribe(const string& q, const string& f, const s
//========================================================================================
ConsoleSessionImpl::ConsoleSessionImpl(Connection& c, const string& options) :
- connection(c), domain("default"), maxAgentAgeMinutes(5), opened(false),
- thread(0), threadCanceled(false),
- lastVisit(0), lastAgePass(0), connectedBrokerInAgentList(false), schemaCache(new SchemaCache())
+ connection(c), domain("default"), authUser(c.getAuthenticatedUsername()), maxAgentAgeMinutes(5),
+ opened(false), thread(0), threadCanceled(false), lastVisit(0), lastAgePass(0),
+ connectedBrokerInAgentList(false), schemaCache(new SchemaCache())
{
if (!options.empty()) {
qpid::messaging::AddressParser parser(options);
diff --git a/qpid/cpp/src/qmf/ConsoleSessionImpl.h b/qpid/cpp/src/qmf/ConsoleSessionImpl.h
index 675c8bcfb5..e495c1c1e8 100644
--- a/qpid/cpp/src/qmf/ConsoleSessionImpl.h
+++ b/qpid/cpp/src/qmf/ConsoleSessionImpl.h
@@ -72,6 +72,7 @@ namespace qmf {
qpid::messaging::Sender directSender;
qpid::messaging::Sender topicSender;
std::string domain;
+ std::string authUser;
uint32_t maxAgentAgeMinutes;
bool listenOnDirect;
bool strictSecurity;