summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/Message.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/broker/Message.cpp')
-rw-r--r--cpp/src/qpid/broker/Message.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/cpp/src/qpid/broker/Message.cpp b/cpp/src/qpid/broker/Message.cpp
index 84d3478173..39f9f85c13 100644
--- a/cpp/src/qpid/broker/Message.cpp
+++ b/cpp/src/qpid/broker/Message.cpp
@@ -144,7 +144,7 @@ void Message::sendContent(framing::FrameHandler& out, uint16_t channel, uint16_t
if (isContentReleased()) {
//load content from store in chunks of maxContentSize
uint16_t maxContentSize = maxFrameSize - AMQFrame::frameOverhead();
- uint64_t expectedSize(frames.getHeaders()->getContentLength());//TODO: how do we know how much data to load?
+ uint64_t expectedSize(frames.getHeaders()->getContentLength());
for (uint64_t offset = 0; offset < expectedSize; offset += maxContentSize)
{
uint64_t remaining = expectedSize - offset;
@@ -153,11 +153,22 @@ void Message::sendContent(framing::FrameHandler& out, uint16_t channel, uint16_t
store->loadContent(*this, data, offset,
remaining > maxContentSize ? maxContentSize : remaining);
+ frame.setBof(false);
+ if (offset > 0) {
+ frame.setBos(false);
+ }
+ if (remaining) {
+ frame.setEos(false);
+ frame.setEof(false);
+ }
out.handle(frame);
}
} else {
- SendContent f(out, channel, maxFrameSize);
+ Count c;
+ frames.map_if(c, TypeFilter(CONTENT_BODY));
+
+ SendContent f(out, channel, maxFrameSize, c.getCount());
frames.map_if(f, TypeFilter(CONTENT_BODY));
}
}