summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/OutputInterceptor.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2009-02-04 20:47:14 +0000
committerAlan Conway <aconway@apache.org>2009-02-04 20:47:14 +0000
commit5b50014477ef0b9096c017af8fb85ac5693e673e (patch)
treef4188e6b16cd304e76e2326aca2f13f1d32fc368 /cpp/src/qpid/cluster/OutputInterceptor.cpp
parentf847d041bc6bf18246bddeff2a219dcbdfa9620c (diff)
downloadqpid-python-5b50014477ef0b9096c017af8fb85ac5693e673e.tar.gz
Fix assertion due to doOutput control being sent after local connection closed.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@740872 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/OutputInterceptor.cpp')
-rw-r--r--cpp/src/qpid/cluster/OutputInterceptor.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/cpp/src/qpid/cluster/OutputInterceptor.cpp b/cpp/src/qpid/cluster/OutputInterceptor.cpp
index dbed75beed..45a369eea9 100644
--- a/cpp/src/qpid/cluster/OutputInterceptor.cpp
+++ b/cpp/src/qpid/cluster/OutputInterceptor.cpp
@@ -34,7 +34,8 @@ using namespace framing;
OutputInterceptor::OutputInterceptor(
cluster::Connection& p, sys::ConnectionOutputHandler& h)
- : parent(p), next(&h), sent(), writeEstimate(p.getCluster().getWriteEstimate()),
+ : parent(p), closing(false), next(&h), sent(),
+ writeEstimate(p.getCluster().getWriteEstimate()),
moreOutput(), doingOutput()
{}
@@ -54,7 +55,7 @@ void OutputInterceptor::activateOutput() {
sys::Mutex::ScopedLock l(lock);
next->activateOutput();
}
- else {
+ else if (!closing) { // Don't send do ouput after output stopped.
QPID_LOG(trace, parent << " activateOutput - sending doOutput");
moreOutput = true;
sendDoOutput();
@@ -117,8 +118,9 @@ void OutputInterceptor::sendDoOutput() {
QPID_LOG(trace, parent << "Send doOutput request for " << request);
}
-void OutputInterceptor::setOutputHandler(sys::ConnectionOutputHandler& h) {
+void OutputInterceptor::closeOutput(sys::ConnectionOutputHandler& h) {
sys::Mutex::ScopedLock l(lock);
+ closing = true;
next = &h;
}