From 355f3d9f24439ced11a250cc387fd9d73faec5b6 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Fri, 11 Jan 2008 15:29:05 +0000 Subject: Allow more than one message to be encoded into a single buffer if available. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@611205 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/qpid/sys/AsynchIOAcceptor.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'qpid/cpp/src') diff --git a/qpid/cpp/src/qpid/sys/AsynchIOAcceptor.cpp b/qpid/cpp/src/qpid/sys/AsynchIOAcceptor.cpp index c2c4b545f9..dd8fe957bd 100644 --- a/qpid/cpp/src/qpid/sys/AsynchIOAcceptor.cpp +++ b/qpid/cpp/src/qpid/sys/AsynchIOAcceptor.cpp @@ -304,8 +304,18 @@ void AsynchIOHandler::idle(AsynchIO&){ buffUsed += frameSize; QPID_LOG(trace, "SENT [" << identifier << "]: " << frame); - if (frameQueue.empty()) - break; + if (frameQueue.empty()) { + //if we have run out of frames, allow upper layers to + //generate more + if (!frameQueueClosed) { + inputHandler->doOutput(); + } + if (frameQueue.empty()) { + //if there are still no frames, we have no more to + //do + break; + } + } frame = frameQueue.front(); frameSize = frame.size(); } -- cgit v1.2.1