diff options
| author | Gordon Sim <gsim@apache.org> | 2013-03-14 19:36:26 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2013-03-14 19:36:26 +0000 |
| commit | ed225592063e88536e662f593f70e43cfdd6eea7 (patch) | |
| tree | 0fb48062f982270e5f0ca0cb4cf000ca2d397418 /cpp/src/qpid/broker/SecureConnectionFactory.cpp | |
| parent | db00c352f1ea3a7668a44aa3059e10d50025bef2 (diff) | |
| download | qpid-python-ed225592063e88536e662f593f70e43cfdd6eea7.tar.gz | |
QPID-4586: add ability to have qpidd establish outgoing connections
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1456621 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/SecureConnectionFactory.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/SecureConnectionFactory.cpp | 19 |
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)); |
