diff options
author | Alan Conway <aconway@apache.org> | 2010-06-24 17:19:58 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2010-06-24 17:19:58 +0000 |
commit | c54e5f2960f37bf059ee9b1b0560b9f9706e67e0 (patch) | |
tree | 976828c83587b15c7e42bd74677670db95b1f798 /cpp/src | |
parent | e68001b8822d4f40ccb9960bc1d0e3533e54fb5d (diff) | |
download | qpid-python-c54e5f2960f37bf059ee9b1b0560b9f9706e67e0.tar.gz |
Fix regression in r956882, sporadic failures of client_test.cpp:testBadClientData
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@957640 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/cluster/Connection.cpp | 23 | ||||
-rw-r--r-- | cpp/src/qpid/cluster/Connection.h | 2 |
2 files changed, 10 insertions, 15 deletions
diff --git a/cpp/src/qpid/cluster/Connection.cpp b/cpp/src/qpid/cluster/Connection.cpp index 42f800bd18..d4f0a06eaf 100644 --- a/cpp/src/qpid/cluster/Connection.cpp +++ b/cpp/src/qpid/cluster/Connection.cpp @@ -262,7 +262,7 @@ void Connection::closed() { // until self-delivery of deliver-close. output.closeOutput(); cluster.getMulticast().mcastControl( - ClusterConnectionDeliverCloseBody(ProtocolVersion(), false), self); + ClusterConnectionDeliverCloseBody(), self); } } catch (const std::exception& e) { @@ -271,31 +271,26 @@ void Connection::closed() { } // Self-delivery of close message, close the connection. -void Connection::deliverClose (bool aborted) { - QPID_LOG(debug, cluster << " replicated close of " << *this); - if (connection.get()) { - if (aborted) connection->abort(); - else connection->closed(); - connection.reset(); - } +void Connection::deliverClose () { + close(); cluster.erase(self); } // Close the connection void Connection::close() { - QPID_LOG(debug, cluster << " local close of " << *this); if (connection.get()) { + QPID_LOG(debug, cluster << " closed connection " << *this); connection->closed(); connection.reset(); } } -// The connection has been killed for misbehaving, called in connection thread. +// The connection has sent invalid data and should be aborted. +// All members will get the same abort since they all process the same data. void Connection::abort() { - if (connection.get()) { - cluster.getMulticast().mcastControl( - ClusterConnectionDeliverCloseBody(ProtocolVersion(), true), self); - } + connection->abort(); + // Aborting the connection will result in a call to ::closed() + // and allow the connection to close in an orderly manner. } // ConnectionCodec::decode receives read buffers from directly-connected clients. diff --git a/cpp/src/qpid/cluster/Connection.h b/cpp/src/qpid/cluster/Connection.h index 72a98c12f1..aec18d73a4 100644 --- a/cpp/src/qpid/cluster/Connection.h +++ b/cpp/src/qpid/cluster/Connection.h @@ -170,7 +170,7 @@ class Connection : const std::string& initFrames); void close(); void abort(); - void deliverClose(bool); + void deliverClose(); OutputInterceptor& getOutput() { return output; } |