diff options
Diffstat (limited to 'cpp/lib/broker/LazyLoadedContent.cpp')
| -rw-r--r-- | cpp/lib/broker/LazyLoadedContent.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/cpp/lib/broker/LazyLoadedContent.cpp b/cpp/lib/broker/LazyLoadedContent.cpp index 2c7a764ec9..d8f18d5c8b 100644 --- a/cpp/lib/broker/LazyLoadedContent.cpp +++ b/cpp/lib/broker/LazyLoadedContent.cpp @@ -20,6 +20,7 @@ */ #include <LazyLoadedContent.h> #include "AMQFrame.h" +#include "framing/ChannelAdapter.h" using namespace qpid::broker; using namespace qpid::framing; @@ -37,19 +38,21 @@ u_int32_t LazyLoadedContent::size() return 0;//all content is written as soon as it is added } -void LazyLoadedContent::send(const qpid::framing::ProtocolVersion& version, OutputHandler* out, int channel, u_int32_t framesize) +void LazyLoadedContent::send(ChannelAdapter& channel, u_int32_t framesize) { if (expectedSize > framesize) { - for (u_int64_t offset = 0; offset < expectedSize; offset += framesize) { + for (u_int64_t offset = 0; offset < expectedSize; offset += framesize) + { u_int64_t remaining = expectedSize - offset; string data; - store->loadContent(msg, data, offset, remaining > framesize ? framesize : remaining); - out->send(new AMQFrame(version, channel, new AMQContentBody(data))); + store->loadContent(msg, data, offset, + remaining > framesize ? framesize : remaining); + channel.send(new AMQContentBody(data)); } } else { string data; store->loadContent(msg, data, 0, expectedSize); - out->send(new AMQFrame(version, channel, new AMQContentBody(data))); + channel.send(new AMQContentBody(data)); } } |
