summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/OutputInterceptor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/cluster/OutputInterceptor.cpp')
-rw-r--r--cpp/src/qpid/cluster/OutputInterceptor.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/cpp/src/qpid/cluster/OutputInterceptor.cpp b/cpp/src/qpid/cluster/OutputInterceptor.cpp
index 4ff0a88b11..8718154d3e 100644
--- a/cpp/src/qpid/cluster/OutputInterceptor.cpp
+++ b/cpp/src/qpid/cluster/OutputInterceptor.cpp
@@ -33,12 +33,12 @@ namespace cluster {
using namespace framing;
OutputInterceptor::OutputInterceptor(cluster::Connection& p, sys::ConnectionOutputHandler& h)
- : parent(p), next(h), sent(), moreOutput(), doingOutput()
+ : parent(p), next(&h), sent(), moreOutput(), doingOutput()
{}
void OutputInterceptor::send(framing::AMQFrame& f) {
Locker l(lock);
- next.send(f);
+ next->send(f);
sent += f.size();
}
@@ -60,7 +60,7 @@ bool OutputInterceptor::doOutput() {
//
void OutputInterceptor::deliverDoOutput(size_t requested) {
Locker l(lock);
- size_t buf = next.getBuffered();
+ size_t buf = next->getBuffered();
if (parent.isLocal())
writeEstimate.delivered(sent, buf); // Update the estimate.
@@ -101,4 +101,9 @@ void OutputInterceptor::sendDoOutput() {
QPID_LOG(trace, &parent << "Send doOutput request for " << request);
}
+void OutputInterceptor::setOutputHandler(sys::ConnectionOutputHandler& h) {
+ Locker l(lock);
+ next = &h;
+}
+
}} // namespace qpid::cluster