From a2a56cf9a7483e165fb579d0b519b284d02009e3 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Wed, 24 Sep 2008 17:34:08 +0000 Subject: Cluster replicates session command sequence state and consumers to newcomers. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@698666 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/cluster/OutputInterceptor.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'cpp/src/qpid/cluster/OutputInterceptor.cpp') diff --git a/cpp/src/qpid/cluster/OutputInterceptor.cpp b/cpp/src/qpid/cluster/OutputInterceptor.cpp index 4424864787..e69992517c 100644 --- a/cpp/src/qpid/cluster/OutputInterceptor.cpp +++ b/cpp/src/qpid/cluster/OutputInterceptor.cpp @@ -45,10 +45,12 @@ void OutputInterceptor::send(framing::AMQFrame& f) { void OutputInterceptor::activateOutput() { Locker l(lock); + if (parent.isCatchUp()) next->activateOutput(); else { moreOutput = true; + QPID_LOG(trace, &parent << " activateOutput - sending doOutput"); sendDoOutput(); } } @@ -79,15 +81,19 @@ void OutputInterceptor::deliverDoOutput(size_t requested) { QPID_LOG(trace, "Delivered doOutput: requested=" << requested << " output=" << sent << " more=" << moreOutput); - if (parent.isLocal() && moreOutput) + if (parent.isLocal() && moreOutput) { + QPID_LOG(trace, &parent << " deliverDoOutput - sending doOutput, more output available."); sendDoOutput(); + } else doingOutput = false; } void OutputInterceptor::startDoOutput() { - if (!doingOutput) + if (!doingOutput) { + QPID_LOG(trace, &parent << " startDoOutput - sending doOutput, more output available."); sendDoOutput(); + } } // Send a doOutput request if one is not already in flight. @@ -111,4 +117,14 @@ void OutputInterceptor::setOutputHandler(sys::ConnectionOutputHandler& h) { next = &h; } +void OutputInterceptor::close() { + Locker l(lock); + next->close(); +} + +size_t OutputInterceptor::getBuffered() const { + Locker l(lock); + return next->getBuffered(); +} + }} // namespace qpid::cluster -- cgit v1.2.1