summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2009-02-24 19:02:50 +0000
committerGordon Sim <gsim@apache.org>2009-02-24 19:02:50 +0000
commit53ac2c08378256c7723b5266e56e6d060e8718e5 (patch)
tree67bf343f4ff2b1c89608f157bb65d012849f430b /qpid/cpp/src
parentebd2cd1461b25ddcfd058fe2bf24917b9e8c4cd4 (diff)
downloadqpid-python-53ac2c08378256c7723b5266e56e6d060e8718e5.tar.gz
QPID-1671: Set userid for client side of inter-broker links.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@747507 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/broker/LinkRegistry.cpp8
-rw-r--r--qpid/cpp/src/qpid/broker/LinkRegistry.h1
2 files changed, 8 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/broker/LinkRegistry.cpp b/qpid/cpp/src/qpid/broker/LinkRegistry.cpp
index 97b1c32d64..229e3c41b7 100644
--- a/qpid/cpp/src/qpid/broker/LinkRegistry.cpp
+++ b/qpid/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/qpid/cpp/src/qpid/broker/LinkRegistry.h b/qpid/cpp/src/qpid/broker/LinkRegistry.h
index 884228bd63..92064692f5 100644
--- a/qpid/cpp/src/qpid/broker/LinkRegistry.h
+++ b/qpid/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);