qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fraser Adams <fraser.ad...@blueyonder.co.uk>
Subject Question about QPID-3492
Date Fri, 16 Dec 2011 17:12:09 GMT
Hi
I was going through some mails from a little while back covering an 
issue with the qpid::messaging ***AddressParser.cpp 
<http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/messaging/AddressParser.cpp?view=log&pathrev=1171715>*

Gordon Sim raised a Jira

https://issues.apache.org/jira/browse/QPID-3492

I was planning on taking a look at this, but I noticed that it was 
marked as fixed in 0.13.

I took a look and the fix is as follows:

--- qpid/trunk/qpid/cpp/src/qpid/messaging/AddressParser.cpp	2011/09/16 18:44:39	1171714
+++ qpid/trunk/qpid/cpp/src/qpid/messaging/AddressParser.cpp	2011/09/16 18:44:59	1171715
@@ -201,7 +201,8 @@
 {
     std::string s;
     if (readWord(s)) {
-        value.parse(s);        
+        value.parse(s);
+        if (value.getType() == VAR_STRING) value.setEncoding("utf8");
         return true;
     } else {
         return false;


This looks great however (and please excuse my ignorance of how 
AddressParser and Variant work) but this patch is applied to 
readSimpleValue() but shouldn't a similar thing be applied to the 
readQuotedValue() method too?

bool AddressParser::readQuotedValue(Variant& value)
{
    std::string s;
    if (readQuotedString(s)) {
        value = s;

      value.setEncoding("utf8");

        return true;
    } else {
        return false;
    }
}

I would think that this would be necessary too wouldn't it? I took a 
look at Variant& Variant::operator=(const std::string& s) and there's no 
setEncoding() going on and the impl = new VariantImpl(std::string(s)); 
inside it looks like it uses the default encoding.

Have I missed something?
Regards,
Frase


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Mime
View raw message