summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/SecureConnectionFactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/broker/SecureConnectionFactory.cpp')
-rw-r--r--cpp/src/qpid/broker/SecureConnectionFactory.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/cpp/src/qpid/broker/SecureConnectionFactory.cpp b/cpp/src/qpid/broker/SecureConnectionFactory.cpp
index 7bc2c94d1c..6b4f6b3025 100644
--- a/cpp/src/qpid/broker/SecureConnectionFactory.cpp
+++ b/cpp/src/qpid/broker/SecureConnectionFactory.cpp
@@ -44,13 +44,7 @@ sys::ConnectionCodec*
SecureConnectionFactory::create(ProtocolVersion v, sys::OutputControl& out, const std::string& id,
const SecuritySettings& external) {
if (v == ProtocolVersion(0, 10)) {
- SecureConnectionPtr sc(new SecureConnection());
- CodecPtr c(new qpid::amqp_0_10::Connection(out, id, false));
- ConnectionPtr i(new broker::Connection(c.get(), broker, id, external, false));
- i->setSecureConnection(sc.get());
- c->setInputHandler(InputPtr(i.release()));
- sc->setCodec(std::auto_ptr<sys::ConnectionCodec>(c));
- return sc.release();
+ return create_0_10(out, id, external, false);
} else {
return broker.getProtocolRegistry().create(v, out, id, external);
}
@@ -61,9 +55,16 @@ sys::ConnectionCodec*
SecureConnectionFactory::create(sys::OutputControl& out, const std::string& id,
const SecuritySettings& external) {
// used to create connections from one broker to another
+ return create_0_10(out, id, external, true);
+}
+
+sys::ConnectionCodec*
+SecureConnectionFactory::create_0_10(sys::OutputControl& out, const std::string& id,
+ const SecuritySettings& external, bool brokerActsAsClient)
+{
SecureConnectionPtr sc(new SecureConnection());
- CodecPtr c(new qpid::amqp_0_10::Connection(out, id, true));
- ConnectionPtr i(new broker::Connection(c.get(), broker, id, external, true ));
+ CodecPtr c(new qpid::amqp_0_10::Connection(out, id, brokerActsAsClient));
+ ConnectionPtr i(new broker::Connection(c.get(), broker, id, external, brokerActsAsClient));
i->setSecureConnection(sc.get());
c->setInputHandler(InputPtr(i.release()));
sc->setCodec(std::auto_ptr<sys::ConnectionCodec>(c));