summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2012-04-18 14:10:26 +0000
committerGordon Sim <gsim@apache.org>2012-04-18 14:10:26 +0000
commit79af16c8793a4c86308f3d8fb7df8d7538be339f (patch)
tree5d48e9295ce3d1255507256c27563d79e57fca88 /cpp/src
parentc8b822b6ba761a230f22a79ffc8e6d853390e0f3 (diff)
downloadqpid-python-79af16c8793a4c86308f3d8fb7df8d7538be339f.tar.gz
QPID-3958: Prevent malformed frameset being set when replicating a message with an empty content frame
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1327515 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/framing/FrameSet.cpp4
-rw-r--r--cpp/src/qpid/framing/FrameSet.h1
-rw-r--r--cpp/src/qpid/replication/ReplicatingEventListener.cpp2
3 files changed, 6 insertions, 1 deletions
diff --git a/cpp/src/qpid/framing/FrameSet.cpp b/cpp/src/qpid/framing/FrameSet.cpp
index d2612e484f..9aee7b98b9 100644
--- a/cpp/src/qpid/framing/FrameSet.cpp
+++ b/cpp/src/qpid/framing/FrameSet.cpp
@@ -102,3 +102,7 @@ std::string FrameSet::getContent() const {
getContent(out);
return out;
}
+
+bool FrameSet::hasContent() const {
+ return parts.size() >= 3;
+}
diff --git a/cpp/src/qpid/framing/FrameSet.h b/cpp/src/qpid/framing/FrameSet.h
index cae75e5ec8..f11bdb938b 100644
--- a/cpp/src/qpid/framing/FrameSet.h
+++ b/cpp/src/qpid/framing/FrameSet.h
@@ -54,6 +54,7 @@ public:
QPID_COMMON_EXTERN void getContent(std::string&) const;
QPID_COMMON_EXTERN std::string getContent() const;
+ bool hasContent() const;
bool isContentBearing() const;
diff --git a/cpp/src/qpid/replication/ReplicatingEventListener.cpp b/cpp/src/qpid/replication/ReplicatingEventListener.cpp
index 3d84a1ce3c..9284bda388 100644
--- a/cpp/src/qpid/replication/ReplicatingEventListener.cpp
+++ b/cpp/src/qpid/replication/ReplicatingEventListener.cpp
@@ -131,7 +131,7 @@ boost::intrusive_ptr<Message> ReplicatingEventListener::cloneMessage(Queue& queu
//cloned body:
AMQFrame header(*original->getFrames().getHeaders());
header.setBof(false);
- header.setEof(!original->getFrames().getContentSize());//if there is any content then the header is not the end of the frameset
+ header.setEof(!original->getFrames().hasContent());//if there are any content frames then the header is not the end of the frameset
header.setBos(true);
header.setEos(true);
handler.handle(header);