diff options
-rw-r--r-- | qpid/cpp/include/qmf/AgentSession.h | 2 | ||||
-rw-r--r-- | qpid/cpp/include/qmf/ConsoleSession.h | 2 | ||||
-rw-r--r-- | qpid/cpp/src/qmf/Agent.cpp | 10 | ||||
-rw-r--r-- | qpid/cpp/src/qmf/ConsoleSession.cpp | 6 | ||||
-rw-r--r-- | qpid/cpp/src/qmf/ConsoleSessionImpl.h | 1 |
5 files changed, 15 insertions, 6 deletions
diff --git a/qpid/cpp/include/qmf/AgentSession.h b/qpid/cpp/include/qmf/AgentSession.h index d6ac5adf83..9e29d6b54b 100644 --- a/qpid/cpp/include/qmf/AgentSession.h +++ b/qpid/cpp/include/qmf/AgentSession.h @@ -69,7 +69,7 @@ namespace qmf { * If False: QMF events are only sent to authorized subscribers * listen-on-direct:{True,False} - If True: Listen on legacy direct-exchange address for backward compatibility [default] * If False: Listen only on the routable direct address - * strict-security:{True,False} - If True: Cooperate with the broker to enforce string access control to the network + * strict-security:{True,False} - If True: Cooperate with the broker to enforce strict access control to the network * - If False: Operate more flexibly with regard to use of messaging facilities [default] */ QMF_EXTERN AgentSession(qpid::messaging::Connection&, const std::string& options=""); diff --git a/qpid/cpp/include/qmf/ConsoleSession.h b/qpid/cpp/include/qmf/ConsoleSession.h index 2422383fa3..0c73e7a6db 100644 --- a/qpid/cpp/include/qmf/ConsoleSession.h +++ b/qpid/cpp/include/qmf/ConsoleSession.h @@ -59,7 +59,7 @@ namespace qmf { * an agent before deleting it [default: 5] * listen-on-direct:{True,False} - If True: Listen on legacy direct-exchange address for backward compatibility [default] * If False: Listen only on the routable direct address - * strict-security:{True,False} - If True: Cooperate with the broker to enforce string access control to the network + * strict-security:{True,False} - If True: Cooperate with the broker to enforce strict access control to the network * - If False: Operate more flexibly with regard to use of messaging facilities [default] */ QMF_EXTERN ConsoleSession(qpid::messaging::Connection&, const std::string& options=""); 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; |