summaryrefslogtreecommitdiff
path: root/qpid/cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2010-06-24 17:19:58 +0000
committerAlan Conway <aconway@apache.org>2010-06-24 17:19:58 +0000
commitbc5441acda9f35bef338677868e46145ce7a418b (patch)
tree9eefdada54f663ca0cae755c0ffe7aa60344e089 /qpid/cpp
parent98e99b9a91eb904df6f5a3c5180195e03dab7b4a (diff)
downloadqpid-python-bc5441acda9f35bef338677868e46145ce7a418b.tar.gz
Fix regression in r956882, sporadic failures of client_test.cpp:testBadClientData
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@957640 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
-rw-r--r--qpid/cpp/src/qpid/cluster/Connection.cpp23
-rw-r--r--qpid/cpp/src/qpid/cluster/Connection.h2
-rw-r--r--qpid/cpp/xml/cluster.xml4
3 files changed, 11 insertions, 18 deletions
diff --git a/qpid/cpp/src/qpid/cluster/Connection.cpp b/qpid/cpp/src/qpid/cluster/Connection.cpp
index 42f800bd18..d4f0a06eaf 100644
--- a/qpid/cpp/src/qpid/cluster/Connection.cpp
+++ b/qpid/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/qpid/cpp/src/qpid/cluster/Connection.h b/qpid/cpp/src/qpid/cluster/Connection.h
index 72a98c12f1..aec18d73a4 100644
--- a/qpid/cpp/src/qpid/cluster/Connection.h
+++ b/qpid/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; }
diff --git a/qpid/cpp/xml/cluster.xml b/qpid/cpp/xml/cluster.xml
index 25ad978e8e..30cd159dd3 100644
--- a/qpid/cpp/xml/cluster.xml
+++ b/qpid/cpp/xml/cluster.xml
@@ -134,9 +134,7 @@
</control>
<!-- Marks the cluster-wide point when a connection is considered closed. -->
- <control name="deliver-close" code="0x2">
- <field name="aborted" type="bit"/>
- </control>
+ <control name="deliver-close" code="0x2"/>
<!-- Permission to generate output up to the limit. -->
<control name="deliver-do-output" code="0x3">