From d490fba74749bcde972e5a0d95f84b165f8ea05e Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Fri, 11 Dec 2009 20:55:45 +0000 Subject: QPID-2266: error sending update: Enqueue capacity threshold exceeded Fix for the problem with a test to verify that messages going to the store have the same headers and content-size for an updatee or a broker that receives the publish directly. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@889813 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/framing/FrameSet.cpp | 5 +++++ cpp/src/qpid/framing/FrameSet.h | 6 ++++++ 2 files changed, 11 insertions(+) (limited to 'cpp/src/qpid/framing') diff --git a/cpp/src/qpid/framing/FrameSet.cpp b/cpp/src/qpid/framing/FrameSet.cpp index f50035e49a..c03dd39458 100644 --- a/cpp/src/qpid/framing/FrameSet.cpp +++ b/cpp/src/qpid/framing/FrameSet.cpp @@ -52,6 +52,11 @@ const AMQMethodBody* FrameSet::getMethod() const return parts.empty() ? 0 : parts[0].getMethod(); } +AMQMethodBody* FrameSet::getMethod() +{ + return parts.empty() ? 0 : parts[0].getMethod(); +} + const AMQHeaderBody* FrameSet::getHeaders() const { return parts.size() < 2 ? 0 : parts[1].castBody(); diff --git a/cpp/src/qpid/framing/FrameSet.h b/cpp/src/qpid/framing/FrameSet.h index e3e8727600..398a709353 100644 --- a/cpp/src/qpid/framing/FrameSet.h +++ b/cpp/src/qpid/framing/FrameSet.h @@ -57,6 +57,7 @@ public: bool isContentBearing() const; QPID_COMMON_EXTERN const AMQMethodBody* getMethod() const; + QPID_COMMON_EXTERN AMQMethodBody* getMethod(); QPID_COMMON_EXTERN const AMQHeaderBody* getHeaders() const; QPID_COMMON_EXTERN AMQHeaderBody* getHeaders(); @@ -70,6 +71,11 @@ public: return (method && method->isA()) ? dynamic_cast(method) : 0; } + template T* as() { + AMQMethodBody* method = getMethod(); + return (method && method->isA()) ? dynamic_cast(method) : 0; + } + template const T* getHeaderProperties() const { const AMQHeaderBody* header = getHeaders(); return header ? header->get() : 0; -- cgit v1.2.1