diff options
author | Gordon Sim <gsim@apache.org> | 2009-02-24 19:02:50 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2009-02-24 19:02:50 +0000 |
commit | b5c611ba1e7462a2b22e76da914c321b2cf3c49b (patch) | |
tree | 4febc1ad8ba114a129dd89111832bf6fd4235d6c /cpp/src | |
parent | 8e106cc7e2312a3d918700038b34c982a6eb32a8 (diff) | |
download | qpid-python-b5c611ba1e7462a2b22e76da914c321b2cf3c49b.tar.gz |
QPID-1671: Set userid for client side of inter-broker links.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@747507 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/broker/LinkRegistry.cpp | 8 | ||||
-rw-r--r-- | cpp/src/qpid/broker/LinkRegistry.h | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/cpp/src/qpid/broker/LinkRegistry.cpp b/cpp/src/qpid/broker/LinkRegistry.cpp index 97b1c32d64..229e3c41b7 100644 --- a/cpp/src/qpid/broker/LinkRegistry.cpp +++ b/cpp/src/qpid/broker/LinkRegistry.cpp @@ -19,19 +19,24 @@ * */ #include "LinkRegistry.h" +#include "Connection.h" #include "qpid/log/Statement.h" #include <iostream> +#include <boost/format.hpp> using namespace qpid::broker; using namespace qpid::sys; using std::pair; using std::stringstream; using boost::intrusive_ptr; +using boost::format; +using boost::str; namespace _qmf = qmf::org::apache::qpid::broker; #define LINK_MAINT_INTERVAL 2 -LinkRegistry::LinkRegistry (Broker* _broker) : broker(_broker), parent(0), store(0), passive(false), passiveChanged(false) +LinkRegistry::LinkRegistry (Broker* _broker) : broker(_broker), parent(0), store(0), passive(false), passiveChanged(false), + realm(broker->getOptions().realm) { timer.add (intrusive_ptr<TimerTask> (new Periodic(*this))); } @@ -241,6 +246,7 @@ void LinkRegistry::notifyConnection(const std::string& key, Connection* c) { l->second->established(); l->second->setConnection(c); + c->setUserId(str(format("%1%@%2%") % l->second->getUsername() % realm)); } } diff --git a/cpp/src/qpid/broker/LinkRegistry.h b/cpp/src/qpid/broker/LinkRegistry.h index 884228bd63..92064692f5 100644 --- a/cpp/src/qpid/broker/LinkRegistry.h +++ b/cpp/src/qpid/broker/LinkRegistry.h @@ -66,6 +66,7 @@ namespace broker { MessageStore* store; bool passive; bool passiveChanged; + std::string realm; void periodicMaintenance (); bool updateAddress(const std::string& oldKey, const TcpAddress& newAddress); |