summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/SessionHandler.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2009-03-04 13:22:03 +0000
committerGordon Sim <gsim@apache.org>2009-03-04 13:22:03 +0000
commit8df34ffd42c067ace66021c031bd46c398a36abe (patch)
treed54f805f922b34deee3becec8cda16c6b7d81609 /cpp/src/qpid/broker/SessionHandler.cpp
parentf029ec74824a402525c9441413976e204f2739a3 (diff)
downloadqpid-python-8df34ffd42c067ace66021c031bd46c398a36abe.tar.gz
QPID-1711: Ensure the session state between the two peers in an inter-broker bridging session are kept in sync.
(Also made changes to cancellation to ensure that the commands are only issued on the io thread of the connection) git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@750002 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/SessionHandler.cpp')
-rw-r--r--cpp/src/qpid/broker/SessionHandler.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/cpp/src/qpid/broker/SessionHandler.cpp b/cpp/src/qpid/broker/SessionHandler.cpp
index 5bdc1e2500..442c3eb34b 100644
--- a/cpp/src/qpid/broker/SessionHandler.cpp
+++ b/cpp/src/qpid/broker/SessionHandler.cpp
@@ -85,11 +85,23 @@ void SessionHandler::readyToSend() {
if (session.get()) session->readyToSend();
}
-// TODO aconway 2008-05-12: hacky - handle attached for bridge clients.
-// We need to integrate the client code so we can run a real client
-// in the bridge.
-//
-void SessionHandler::attached(const std::string& name) {
+/**
+ * Used by inter-broker bridges to set up session id and attach
+ */
+void SessionHandler::attachAs(const std::string& name)
+{
+ SessionId id(connection.getUserId(), name);
+ SessionState::Configuration config = connection.broker.getSessionManager().getSessionConfig();
+ session.reset(new SessionState(connection.getBroker(), *this, id, config));
+ sendAttach(false);
+}
+
+/**
+ * TODO: this is a little ugly, fix it; its currently still relied on
+ * for 'push' bridges
+ */
+void SessionHandler::attached(const std::string& name)
+{
if (session.get()) {
amqp_0_10::SessionHandler::attached(name);
} else {