qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r1524505 - /qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp
Date Wed, 18 Sep 2013 18:01:55 GMT
Author: gsim
Date: Wed Sep 18 18:01:54 2013
New Revision: 1524505

URL: http://svn.apache.org/r1524505
Log:
QPID-5141: always set content object on 0-10 path (unless explicitly asked not to)

Modified:
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp?rev=1524505&r1=1524504&r2=1524505&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp Wed Sep 18 18:01:54 2013
@@ -26,6 +26,7 @@
 #include "qpid/messaging/Receiver.h"
 #include "qpid/messaging/Session.h"
 #include "qpid/amqp_0_10/Codecs.h"
+#include "qpid/types/encodings.h"
 
 namespace qpid {
 namespace client {
@@ -155,6 +156,10 @@ ReceiverImpl::ReceiverImpl(SessionImpl& 
     parent(&p), destination(name), address(a), byteCredit(0xFFFFFFFF), autoDecode(autoDecode_),
     state(UNRESOLVED), capacity(0), window(0) {}
 
+namespace {
+const std::string TEXT_PLAIN("text/plain");
+}
+
 bool ReceiverImpl::getImpl(qpid::messaging::Message& message, qpid::messaging::Duration
timeout)
 {
     {
@@ -169,6 +174,13 @@ bool ReceiverImpl::getImpl(qpid::messagi
             } else if (message.getContentType() == qpid::amqp_0_10::ListCodec::contentType)
{
                 message.getContentObject() = qpid::types::Variant::List();
                 decode(message, message.getContentObject().asList());
+            } else if (!message.getContentBytes().empty()) {
+                message.getContentObject() = message.getContentBytes();
+                if (message.getContentType() == TEXT_PLAIN) {
+                    message.getContentObject().setEncoding(qpid::types::encodings::UTF8);
+                } else {
+                    message.getContentObject().setEncoding(qpid::types::encodings::BINARY);
+                }
             }
         }
         return true;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message