summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/framing/SendContent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/framing/SendContent.cpp')
-rw-r--r--cpp/src/qpid/framing/SendContent.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/cpp/src/qpid/framing/SendContent.cpp b/cpp/src/qpid/framing/SendContent.cpp
index a62e4eeb72..a26c19037b 100644
--- a/cpp/src/qpid/framing/SendContent.cpp
+++ b/cpp/src/qpid/framing/SendContent.cpp
@@ -19,7 +19,7 @@
*
*/
-#include "SendContent.h"
+#include "qpid/framing/SendContent.h"
qpid::framing::SendContent::SendContent(FrameHandler& h, uint16_t mfs, uint efc) : handler(h),
maxFrameSize(mfs),
@@ -34,13 +34,13 @@ void qpid::framing::SendContent::operator()(const AMQFrame& f)
real frame size, hence substract -1 from frameOverhead()*/
uint16_t maxContentSize = maxFrameSize - (AMQFrame::frameOverhead() - 1);
const AMQContentBody* body(f.castBody<AMQContentBody>());
- if (body->size() > maxContentSize) {
+ if (body->encodedSize() > maxContentSize) {
uint32_t offset = 0;
- for (int chunk = body->size() / maxContentSize; chunk > 0; chunk--) {
- sendFragment(*body, offset, maxContentSize, first && offset == 0, last && offset + maxContentSize == body->size());
+ for (int chunk = body->encodedSize() / maxContentSize; chunk > 0; chunk--) {
+ sendFragment(*body, offset, maxContentSize, first && offset == 0, last && offset + maxContentSize == body->encodedSize());
offset += maxContentSize;
}
- uint32_t remainder = body->size() % maxContentSize;
+ uint32_t remainder = body->encodedSize() % maxContentSize;
if (remainder) {
sendFragment(*body, offset, remainder, first && offset == 0, last);
}
@@ -53,8 +53,7 @@ void qpid::framing::SendContent::operator()(const AMQFrame& f)
void qpid::framing::SendContent::sendFragment(const AMQContentBody& body, uint32_t offset, uint16_t size, bool first, bool last) const
{
- AMQFrame fragment(in_place<AMQContentBody>(
- body.getData().substr(offset, size)));
+ AMQFrame fragment((AMQContentBody(body.getData().substr(offset, size))));
setFlags(fragment, first, last);
handler.handle(fragment);
}