diff options
| author | Kim van der Riet <kpvdr@apache.org> | 2013-02-28 16:14:30 +0000 |
|---|---|---|
| committer | Kim van der Riet <kpvdr@apache.org> | 2013-02-28 16:14:30 +0000 |
| commit | 9c73ef7a5ac10acd6a50d5d52bd721fc2faa5919 (patch) | |
| tree | 2a890e1df09e5b896a9b4168a7b22648f559a1f2 /cpp/src/qpid/broker/amqp_0_10 | |
| parent | 172d9b2a16cfb817bbe632d050acba7e31401cd2 (diff) | |
| download | qpid-python-asyncstore.tar.gz | |
Update from trunk r1375509 through r1450773asyncstore
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1451244 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/amqp_0_10')
| -rw-r--r-- | cpp/src/qpid/broker/amqp_0_10/MessageTransfer.cpp | 13 | ||||
| -rw-r--r-- | cpp/src/qpid/broker/amqp_0_10/MessageTransfer.h | 1 |
2 files changed, 7 insertions, 7 deletions
diff --git a/cpp/src/qpid/broker/amqp_0_10/MessageTransfer.cpp b/cpp/src/qpid/broker/amqp_0_10/MessageTransfer.cpp index cac4434c48..b78b69b2d6 100644 --- a/cpp/src/qpid/broker/amqp_0_10/MessageTransfer.cpp +++ b/cpp/src/qpid/broker/amqp_0_10/MessageTransfer.cpp @@ -29,6 +29,7 @@ #include "qpid/framing/TypeFilter.h" #include "qpid/framing/SendContent.h" #include "qpid/log/Statement.h" +#include "boost/lexical_cast.hpp" using namespace qpid::framing; @@ -51,7 +52,12 @@ std::string MessageTransfer::getAnnotationAsString(const std::string& key) const { const qpid::framing::MessageProperties* mp = getProperties<qpid::framing::MessageProperties>(); if (mp && mp->hasApplicationHeaders()) { - return mp->getApplicationHeaders().getAsString(key); + FieldTable::ValuePtr value = mp->getApplicationHeaders().get(key); + if (value) { + if (value->convertsTo<std::string>()) return value->get<std::string>(); + else if (value->convertsTo<int>()) return boost::lexical_cast<std::string>(value->get<int>()); + } + return std::string(); } else { return std::string(); } @@ -116,11 +122,6 @@ void MessageTransfer::computeRequiredCredit() requiredCredit = sum.getSize(); cachedRequiredCredit = true; } -uint32_t MessageTransfer::getRequiredCredit(const qpid::broker::Message& msg) -{ - //TODO: may need to reflect annotations and other modifications in this also - return get(msg).getRequiredCredit(); -} qpid::framing::FrameSet& MessageTransfer::getFrames() { diff --git a/cpp/src/qpid/broker/amqp_0_10/MessageTransfer.h b/cpp/src/qpid/broker/amqp_0_10/MessageTransfer.h index 590e389518..9e432235e6 100644 --- a/cpp/src/qpid/broker/amqp_0_10/MessageTransfer.h +++ b/cpp/src/qpid/broker/amqp_0_10/MessageTransfer.h @@ -109,7 +109,6 @@ class MessageTransfer : public qpid::broker::Message::Encoding, public qpid::bro QPID_BROKER_EXTERN bool isLastQMFResponse(const std::string correlation) const; static bool isImmediateDeliveryRequired(const qpid::broker::Message& message); - static uint32_t getRequiredCredit(const qpid::broker::Message&); static MessageTransfer& get(qpid::broker::Message& message) { return *dynamic_cast<MessageTransfer*>(&message.getEncoding()); } |
