Subject: | Net-Dbus-0.33.4 |
Date: | Mon, 16 Jul 2007 14:20:00 +0200 |
To: | <bug-Net-DBus [...] rt.cpan.org> |
From: | "Braat, J.A. (Jacco)" <jacco.braat [...] tno.nl> |
Hello,
i think there is a problem with handling of the "magic" variable.
For example:
dbus_method("name", ["caller","int16"],[]);
sub name {
my ($self, $caller, $i) = @_;
}
$i is undefined because in Introspector.pm -> decode() the iterator pops
a value from the message even for the magic variables.
The following change makes it work.
Jacco.
--- Introspector.pm Sun Nov 5 22:47:57 2006
+++
/usr/local/lib/perl5/site_perl/5.8.8/mach/Net/DBus/Binding/Introspector.
pm Mon Jul 16 13:53:11 2007
@@ -1047,16 +1047,25 @@
my @rawtypes = $self->_convert(@types);
my @ret;
- do {
- my $type = shift @types;
- my $rawtype = shift @rawtypes;
+ my $ttype;
+ my $rawtype;
+ while (defined($ttype = shift @types)) {
+ $rawtype = shift @rawtypes;
- if (exists $magic_type_map{$type}) {
- push @ret, &$rawtype($message);
- } else {
- push @ret, $iter->get($rawtype);
+ if (exists $magic_type_map{$ttype}) {
+ push @ret, &$rawtype($message);
+ } else {
+ push @ret, $iter->get($rawtype);
+ last unless ($iter->next);
+ }
+ }
+ while (defined($ttype = shift @types)) {
+ $rawtype = shift @rawtypes;
+
+ if (exists $magic_type_map{$ttype}) {
+ push @ret, &$rawtype($message);
+ }
}
- } while ($iter->next);
return @ret;
}
This e-mail and its contents are subject to the DISCLAIMER at http://www.tno.nl/disclaimer/email.html