Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Net-Rendezvous-Publish-Backend-Avahi CPAN distribution.

Report information
The Basics
Id: 63330
Status: resolved
Priority: 0/
Queue: Net-Rendezvous-Publish-Backend-Avahi

People
Owner: Nobody in particular
Requestors: mss [...] apache.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.03
Fixed in: (no value)



Subject: [PATCH] publish throws warnings
This module tends to throw the following warning: Use of uninitialized value in split at /usr/share/perl5/Net/Rendezvous/Publish/Backend/Avahi.pm line 39. The problem is the handling of the (undocumented) txt argument. Attached is an (untested) patch which should fix this.
Subject: Avahi.patch
--- Avahi.pm.orig 2007-05-07 07:13:11.000000000 +0200 +++ Avahi.pm 2010-11-25 13:48:21.618178003 +0100 @@ -26,20 +26,30 @@ my $self = shift; my %args = @_; + # AddService argument signature is aay. Split first into key/value + # pairs at character \x01 ... + my $txt = $args{txt} || []; + unless (ref $txt) { + $txt = [map { + [(split //, $_)] + } (split /\x01/, $txt)]); + } + # ... then map characters to bytes and add DBus type. + if (@{$txt}) { + foreach my $t (@{$txt}) { + map { + $_ = Net::DBus::dbus_byte(ord($_)) + } @{$t}; + } + } + my $group = $self->{service}->get_object( $self->{server}->EntryGroupNew, 'org.freedesktop.Avahi.EntryGroup'); $group->AddService(Net::DBus::dbus_int32(-1), Net::DBus::dbus_int32(-1), Net::DBus::dbus_uint32(0), $args{name}, $args{type}, $args{domain}, $args{host}, Net::DBus::dbus_uint16($args{port}), + $txt); - # AddService argument signature is aay. Split first into key/value - # pairs at character \x01, then map characters to bytes and add DBus - # type. - [map { - [map { - Net::DBus::dbus_byte(ord($_)) - } (split //, $_)] - } (split /\x01/, $args{txt})]); $group->Commit; return $group;
 Applied, thanks! Will be out in the next release.