summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2013-09-25 11:28:19 +0000
committerGordon Sim <gsim@apache.org>2013-09-25 11:28:19 +0000
commit39e85864268b4b4b32f53135571a57067b47abcb (patch)
treebc3e3d721c8880111f18ee64d0efea8db523c3d9 /qpid/cpp/src
parentf32d1e11b56b884c8dffb23c719a6ba89683522a (diff)
downloadqpid-python-39e85864268b4b4b32f53135571a57067b47abcb.tar.gz
QPID-5150: further fixes for QMFv2 over AMQP 1.0; use content from converted 0-10 transfer rather than message as received
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1526156 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/management/ManagementAgent.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/qpid/cpp/src/qpid/management/ManagementAgent.cpp b/qpid/cpp/src/qpid/management/ManagementAgent.cpp
index d80dd6e6a3..d4a07f407c 100644
--- a/qpid/cpp/src/qpid/management/ManagementAgent.cpp
+++ b/qpid/cpp/src/qpid/management/ManagementAgent.cpp
@@ -2122,19 +2122,21 @@ bool ManagementAgent::authorizeAgentMessage(Message& msg)
string methodName;
string cid;
+ boost::intrusive_ptr<const qpid::broker::amqp_0_10::MessageTransfer> transfer = protocols->translate(msg);
//
- // If the message is larger than our working buffer size, we can't determine if it's
- // authorized or not. In this case, return true (authorized) if there is no ACL in place,
- // otherwise return false;
+ // If the message is larger than our working buffer size (or if it
+ // could not be converted to an 0-10 messgae-transfer), we can't
+ // determine if it's authorized or not. In this case, return true
+ // (authorized) if there is no ACL in place, otherwise return
+ // false;
//
- if (msg.getContentSize() > qmfV1BufferSize)
+ if (!transfer || transfer->getContentSize() > qmfV1BufferSize)
return broker->getAcl() == 0;
- inBuffer.putRawData(msg.getContent());
+ inBuffer.putRawData(transfer->getContent());
uint32_t bufferLen = inBuffer.getPosition();
inBuffer.reset();
- boost::intrusive_ptr<const qpid::broker::amqp_0_10::MessageTransfer> transfer = protocols->translate(msg);
const framing::MessageProperties* p =
transfer ? transfer->getFrames().getHeaders()->get<framing::MessageProperties>() : 0;
@@ -2283,13 +2285,13 @@ void ManagementAgent::dispatchAgentCommand(Message& msg, bool viaLocal)
ResizableBuffer inBuffer(qmfV1BufferSize);
uint8_t opcode;
- if (msg.getContentSize() > qmfV1BufferSize) {
+ if (transfer->getContentSize() > qmfV1BufferSize) {
QPID_LOG(debug, "ManagementAgent::dispatchAgentCommandLH: Message too large: " <<
- msg.getContentSize());
+ transfer->getContentSize());
return;
}
- inBuffer.putRawData(msg.getContent());
+ inBuffer.putRawData(transfer->getContent());
uint32_t bufferLen = inBuffer.getPosition();
inBuffer.reset();