Author: gsim
Date: Wed Apr 18 14:10:26 2012
New Revision: 1327515
URL: http://svn.apache.org/viewvc?rev=1327515&view=rev
Log:
QPID-3958: Prevent malformed frameset being set when replicating a message with
an empty content frame
Modified:
qpid/trunk/qpid/cpp/src/qpid/framing/FrameSet.cpp
qpid/trunk/qpid/cpp/src/qpid/framing/FrameSet.h
qpid/trunk/qpid/cpp/src/qpid/replication/ReplicatingEventListener.cpp
Modified: qpid/trunk/qpid/cpp/src/qpid/framing/FrameSet.cpp
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/framing/FrameSet.cpp?rev=1327515&r1=1327514&r2=1327515&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/framing/FrameSet.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/framing/FrameSet.cpp Wed Apr 18 14:10:26 2012
@@ -102,3 +102,7 @@ std::string FrameSet::getContent() const
getContent(out);
return out;
}
+
+bool FrameSet::hasContent() const {
+ return parts.size() >= 3;
+}
Modified: qpid/trunk/qpid/cpp/src/qpid/framing/FrameSet.h
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/framing/FrameSet.h?rev=1327515&r1=1327514&r2=1327515&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/framing/FrameSet.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/framing/FrameSet.h Wed Apr 18 14:10:26 2012
@@ -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;
Modified: qpid/trunk/qpid/cpp/src/qpid/replication/ReplicatingEventListener.cpp
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/replication/ReplicatingEventListener.cpp?rev=1327515&r1=1327514&r2=1327515&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/replication/ReplicatingEventListener.cpp
(original)
+++ qpid/trunk/qpid/cpp/src/qpid/replication/ReplicatingEventListener.cpp Wed
Apr 18 14:10:26 2012
@@ -131,7 +131,7 @@ boost::intrusive_ptr<Message> Replicatin
//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);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]