summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/Connection.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2010-08-23 21:04:33 +0000
committerAlan Conway <aconway@apache.org>2010-08-23 21:04:33 +0000
commit50ed4bea1348e2a8f7e2df82cb3148798862011c (patch)
tree0eeebc6ccb64b770313dea786766e89eaa15e949 /cpp/src/qpid/cluster/Connection.cpp
parent867cc757efb2341a1293f2daa412b8aacd75c515 (diff)
downloadqpid-python-50ed4bea1348e2a8f7e2df82cb3148798862011c.tar.gz
Check for and abort invalid catchup connections.
Detect attempt to make a catch-up connection while we are not expecting an update. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@988312 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/Connection.cpp')
-rw-r--r--cpp/src/qpid/cluster/Connection.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/cpp/src/qpid/cluster/Connection.cpp b/cpp/src/qpid/cluster/Connection.cpp
index 923d66ad34..e76cebf68d 100644
--- a/cpp/src/qpid/cluster/Connection.cpp
+++ b/cpp/src/qpid/cluster/Connection.cpp
@@ -257,7 +257,7 @@ void Connection::closed() {
close();
cluster.updateInClosed();
}
- else if (catchUp) {
+ else if (catchUp && cluster.isExpectingUpdate()) {
QPID_LOG(critical, cluster << " catch-up connection closed prematurely " << *this);
cluster.leave();
}
@@ -304,6 +304,10 @@ size_t Connection::decode(const char* data, size_t size) {
const char* ptr = data;
const char* end = data + size;
if (catchUp) { // Handle catch-up locally.
+ if (!cluster.isExpectingUpdate()) {
+ QPID_LOG(error, "Rejecting unexpected catch-up connection.");
+ abort(); // Cluster is not expecting catch-up connections.
+ }
bool wasOpen = connection->isOpen();
Buffer buf(const_cast<char*>(ptr), size);
ptr += size;