Protocols.XMLRPC contains the following:
protected mixed decode(string xml_input, string dtd_input, int|void
boolean)
{
// We cannot insert 0 integers directly into the parse tree, so
// we'll use magic_zero as a placeholder and destruct it afterwards.
object magic_zero = class {}();
...
case "int":
return (int)(data*"") || magic_zero;
...
destruct(magic_zero); // Apply Magic! Replace magic_zero with real 0:s.
unfortunately this doesn't quite work:
Pike v7.9 release 5 running Hilfe v3.5 (Incremental Pike Frontend)
> object magic_zero = class {}();
> mapping foo = ([ "foo":magic_zero ]);
> destruct(magic_zero);
Compiler Warning: 1: Returning a void expression. Converted to zero.
(1) Result: 0
> foreach(foo; string key; mixed val){ write("%O\n", intp(val)); }
0
Ok.
in other words, in this situation, the magic zero is not recognized as
an int.
this causes for example xml-rpc-call in
modules/tags/additional_rxml.pike to fail:
format_response:
else if (intp (val))
buf->add ("<int>", (string) val, "</int>\n");
...
else { // Gotta be a Calendar object.
// Format this to be compatible with the iso-time attribute
// to the <date> tag.
buf->add ("<iso-date-time>", val->format_time(),
"</iso-date-time>\n");
}
failing with: Internal server error: Lookup in destructed object.