fix bug with undef vals in hosts struct

This commit is contained in:
Oliver Gorwits
2014-04-21 21:18:26 +00:00
parent 67a0e6ca22
commit 6eefcf648b

View File

@@ -103,14 +103,13 @@ addresses which resolved.
sub hostnames_resolve_async { sub hostnames_resolve_async {
my $ips = shift; my $ips = shift;
my $resolver = AnyEvent::DNS->new(); my $resolver = AnyEvent::DNS->new();
my %HOSTS = (); my %HOSTS = ();
$HOSTS{$_} = [ map { [ format_address $_->[0] ] } $HOSTS{$_} = [ map { [ $_ ? (format_address $_->[0]) : '' ] }
@{$AnyEvent::DNS::EtcHosts::HOSTS{$_}} ] @{$AnyEvent::DNS::EtcHosts::HOSTS{$_}} ]
for keys %AnyEvent::DNS::EtcHosts::HOSTS; for keys %AnyEvent::DNS::EtcHosts::HOSTS;
# Set up the condvar # Set up the condvar
my $done = AE::cv; my $done = AE::cv;
$done->begin( sub { shift->send } ); $done->begin( sub { shift->send } );