Close socket upon completion of async DNS resolution

This commit is contained in:
Eric A. Miller
2014-07-15 22:52:25 -04:00
parent 29f4231be9
commit c3b34b1a83
2 changed files with 4 additions and 1 deletions

View File

@@ -7,6 +7,7 @@
[BUG FIXES]
* No default for interactives made daemon die (H. Weber)
* Close socket upon completion of async DNS resolution
2.028001 - 2014-07-13

View File

@@ -103,7 +103,6 @@ addresses which resolved.
sub hostnames_resolve_async {
my $ips = shift;
my $resolver = AnyEvent::DNS->new();
my %HOSTS = ();
$HOSTS{$_} = [ map { [ $_ ? (format_address $_->[0]) : '' ] }
@@ -136,6 +135,9 @@ sub hostnames_resolve_async {
# Wait for the resolver to perform all resolutions
$done->recv;
# Remove reference to resolver so that we close sockets
undef $AnyEvent::DNS::RESOLVER if $AnyEvent::DNS::RESOLVER;
return $ips;
}