From 8425f7a31dab66d917b441d8b7e69090bff07e11 Mon Sep 17 00:00:00 2001 From: "ian%hixie.ch" Date: Thu, 5 Sep 2002 21:15:15 +0000 Subject: [PATCH] Minor bug fixes: Make anonymous arguments start from 1 not 0; make a zero argument response have a response (a true boolean); make outputs with zero or one arguments be handled as outputs instead of implied property accesses. git-svn-id: svn://10.0.0.236/trunk@128906 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/PLIF/PLIF/Service/XMLRPC.pm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/mozilla/webtools/PLIF/PLIF/Service/XMLRPC.pm b/mozilla/webtools/PLIF/PLIF/Service/XMLRPC.pm index cb3e629062e..8c7e01a412a 100644 --- a/mozilla/webtools/PLIF/PLIF/Service/XMLRPC.pm +++ b/mozilla/webtools/PLIF/PLIF/Service/XMLRPC.pm @@ -69,7 +69,7 @@ sub decodeXMLRPC { if (@$values == 1 and $values->[0]->type eq 'struct') { $arguments = $values->[0]->value; } else { - my $index = 0; + my $index = 1; $arguments = {}; foreach my $argument (@$values) { $arguments->{$index++} = $argument->value; @@ -115,12 +115,22 @@ sub methodMissing { } if (@arguments > 1) { $response = RPC::XML::response->new(RPC::XML::array->new(@arguments)); - } else { + } elsif (@arguments) { $response = RPC::XML::response->new(@arguments); + } else { + $response = RPC::XML::response->new(RPC::XML::boolean->new(1)); # XXX } $self->output->XMLRPC($response->as_string); } +# disable implied property access so that all method calls are routed +# through methodMissing() above. +sub propertyImpliedAccessAllowed { + my $self = shift; + my($name) = @_; + return ($name eq 'output'); +} + # This is commented out because the default generic output module # defaults to this behaviour anyway, and we don't really want this # module being probed for output.generic.dispatcher stuff since it has