summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2010-03-02 01:02:30 +0000
committerTed Ross <tross@apache.org>2010-03-02 01:02:30 +0000
commit4133cb8e05f8ea6bac29e1e5cf81afaa3d3a591a (patch)
treea273321c7d84e75c7f95fe271106fb81090bb173 /qpid/cpp/src
parent10e6d0d251e8da42ab3e401dc75b0661bcee301e (diff)
downloadqpid-python-4133cb8e05f8ea6bac29e1e5cf81afaa3d3a591a.tar.gz
Rebased the qmf-devel branch to the trunk
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/qmf-devel0.7@917828 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/cluster/Connection.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/qpid/cpp/src/qpid/cluster/Connection.cpp b/qpid/cpp/src/qpid/cluster/Connection.cpp
index a375a65851..909ff68d92 100644
--- a/qpid/cpp/src/qpid/cluster/Connection.cpp
+++ b/qpid/cpp/src/qpid/cluster/Connection.cpp
@@ -159,6 +159,11 @@ bool Connection::doOutput() {
// Received from a directly connected client.
void Connection::received(framing::AMQFrame& f) {
+ if (!connection.get()) {
+ QPID_LOG(warning, cluster << " ignoring frame on closed connection "
+ << *this << ": " << f);
+ return;
+ }
QPID_LOG(trace, cluster << " RECV " << *this << ": " << f);
if (isLocal()) { // Local catch-up connection.
currentChannel = f.getChannel();
@@ -231,7 +236,7 @@ void Connection::closed() {
}
else if (isUpdated()) {
QPID_LOG(debug, cluster << " closed update connection " << *this);
- connection->closed();
+ if (connection.get()) connection->closed();
}
else if (isLocal()) {
QPID_LOG(debug, cluster << " local close of replicated connection " << *this);
@@ -250,13 +255,21 @@ void Connection::closed() {
// Self-delivery of close message, close the connection.
void Connection::deliverClose () {
assert(!catchUp);
- connection->closed();
+ if (connection.get()) {
+ connection->closed();
+ // Ensure we delete the broker::Connection in the deliver thread.
+ connection.reset();
+ }
cluster.erase(self);
}
// The connection has been killed for misbehaving
void Connection::abort() {
- if (connection.get()) connection->abort();
+ if (connection.get()) {
+ connection->abort();
+ // Ensure we delete the broker::Connection in the deliver thread.
+ connection.reset();
+ }
cluster.erase(self);
}
@@ -324,7 +337,6 @@ void Connection::sessionState(
const SequenceSet& unknownCompleted,
const SequenceSet& receivedIncomplete)
{
-
sessionState().setState(
replayStart,
sendCommandPoint,