From 6dfe93d5e0f21127d8454d17c6b79a2ec0dc519d Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Fri, 19 Oct 2012 17:15:46 +0000 Subject: QPID-4368: Allow pluggable protocol implementations git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1400177 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/SecureConnectionFactory.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'cpp/src/qpid/broker/SecureConnectionFactory.cpp') diff --git a/cpp/src/qpid/broker/SecureConnectionFactory.cpp b/cpp/src/qpid/broker/SecureConnectionFactory.cpp index 757f6efc59..e5657fd93e 100644 --- a/cpp/src/qpid/broker/SecureConnectionFactory.cpp +++ b/cpp/src/qpid/broker/SecureConnectionFactory.cpp @@ -31,7 +31,7 @@ namespace broker { using framing::ProtocolVersion; using qpid::sys::SecuritySettings; -typedef std::auto_ptr CodecPtr; +typedef std::auto_ptr CodecPtr; typedef std::auto_ptr SecureConnectionPtr; typedef std::auto_ptr ConnectionPtr; typedef std::auto_ptr InputPtr; @@ -43,12 +43,14 @@ SecureConnectionFactory::create(ProtocolVersion v, sys::OutputControl& out, cons const SecuritySettings& external) { if (v == ProtocolVersion(0, 10)) { SecureConnectionPtr sc(new SecureConnection()); - CodecPtr c(new amqp_0_10::Connection(out, id, false)); + 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(c)); return sc.release(); + } else { + return broker.getProtocolRegistry().create(v, out, id, external); } return 0; } @@ -58,7 +60,7 @@ SecureConnectionFactory::create(sys::OutputControl& out, const std::string& id, const SecuritySettings& external) { // used to create connections from one broker to another SecureConnectionPtr sc(new SecureConnection()); - CodecPtr c(new amqp_0_10::Connection(out, id, true)); + CodecPtr c(new qpid::amqp_0_10::Connection(out, id, true)); ConnectionPtr i(new broker::Connection(c.get(), broker, id, external, true )); i->setSecureConnection(sc.get()); c->setInputHandler(InputPtr(i.release())); -- cgit v1.2.1