----- Original Message ----
From: "Martin Stjernholm, Roxen IS @ Pike developers forum" 10353@lyskom.lysator.liu.se To: pike-devel@lists.lysator.liu.se Sent: Sat, September 10, 2011 12:30:11 PM Subject: Re: Val.true and Val.false [Was: XMLRPC] (from pike@roxen.com)
The patch in decode() is good, but it isn't backward compatible since old code might expect the integers 0 and 1 for booleans. This is what we discussed earlier on whether or not to make the boolean objects int-like.
As I said earlier, I suggest an optional flag to Client/AsyncClient to enable the newstyle decode mode in responses, and to decode_call to enable it for incoming calls.
I also miss a corresponding patch in 7.9.
Well, I've got a compat mode thing going, but the decode of the boolean (in the new patch) isn't working correctly. It probably wasn't in the previous patch either. Val.false won't get returned, because it is 0, and the documentation says 0 won't get returned, which it won't, it turns into an empty string (part of the xml parse). Probably because it prints as an int, even though it isn't. I presume Val.true works correctly, I haven't been able to test it yet. Trying to find some xmlrpc data from my server that will return true, but everything is false so far.
May have to be satisfied with false being returned as 0 instead of Val.false, and true being returned as Val.true as expected.
Perhaps someone can see where my error lies, if any?