diff options
author | Alan Conway <aconway@apache.org> | 2009-07-30 18:46:17 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2009-07-30 18:46:17 +0000 |
commit | 2a2ad630c4a7afeca560977fa71759389eca42ba (patch) | |
tree | 7f1400b40545286cb4ff586bf7aadbe72b44f0f0 /cpp/src/qpid/cluster/ConnectionCodec.cpp | |
parent | adc8062ac65028c1c3daf07a33b24145200d3e20 (diff) | |
download | qpid-python-2a2ad630c4a7afeca560977fa71759389eca42ba.tar.gz |
Set protocol versions correctly in cluster code.
Cluster code was broken by a recent checkin to validate protocol
versions. The cluster was not correctly setting the version on both
sides of a connection.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@799401 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/ConnectionCodec.cpp')
-rw-r--r-- | cpp/src/qpid/cluster/ConnectionCodec.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/cpp/src/qpid/cluster/ConnectionCodec.cpp b/cpp/src/qpid/cluster/ConnectionCodec.cpp index 0c791cdf44..4ff8b0a4a3 100644 --- a/cpp/src/qpid/cluster/ConnectionCodec.cpp +++ b/cpp/src/qpid/cluster/ConnectionCodec.cpp @@ -38,24 +38,27 @@ using namespace framing; sys::ConnectionCodec* ConnectionCodec::Factory::create(ProtocolVersion v, sys::OutputControl& out, const std::string& id) { if (v == ProtocolVersion(0, 10)) - return new ConnectionCodec(out, id, cluster, false, false); - else if (v == ProtocolVersion(0x80 + 0, 0x80 + 10)) - return new ConnectionCodec(out, id, cluster, true, false); // Catch-up connection + return new ConnectionCodec(v, out, id, cluster, false, false); + else if (v == ProtocolVersion(0x80 + 0, 0x80 + 10)) // Catch-up connection + return new ConnectionCodec(v, out, id, cluster, true, false); return 0; } // Used for outgoing Link connections sys::ConnectionCodec* ConnectionCodec::Factory::create(sys::OutputControl& out, const std::string& logId) { - return new ConnectionCodec(out, logId, cluster, false, true); + return new ConnectionCodec(ProtocolVersion(0,10), out, logId, cluster, false, true); } -ConnectionCodec::ConnectionCodec(sys::OutputControl& out, const std::string& logId, Cluster& cluster, bool catchUp, bool isLink) - : codec(out, logId, isLink), - interceptor(new Connection(cluster, codec, logId, cluster.getId(), catchUp, isLink)) +ConnectionCodec::ConnectionCodec( + const ProtocolVersion& v, sys::OutputControl& out, + const std::string& logId, Cluster& cluster, bool catchUp, bool isLink +) : codec(out, logId, isLink), + interceptor(new Connection(cluster, codec, logId, cluster.getId(), catchUp, isLink)) { std::auto_ptr<sys::ConnectionInputHandler> ih(new ProxyInputHandler(interceptor)); codec.setInputHandler(ih); + codec.setVersion(v); } ConnectionCodec::~ConnectionCodec() {} |