Close socket upon completion of async DNS resolution
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
[BUG FIXES]
|
[BUG FIXES]
|
||||||
|
|
||||||
* No default for interactives made daemon die (H. Weber)
|
* No default for interactives made daemon die (H. Weber)
|
||||||
|
* Close socket upon completion of async DNS resolution
|
||||||
|
|
||||||
2.028001 - 2014-07-13
|
2.028001 - 2014-07-13
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,6 @@ addresses which resolved.
|
|||||||
|
|
||||||
sub hostnames_resolve_async {
|
sub hostnames_resolve_async {
|
||||||
my $ips = shift;
|
my $ips = shift;
|
||||||
my $resolver = AnyEvent::DNS->new();
|
|
||||||
|
|
||||||
my %HOSTS = ();
|
my %HOSTS = ();
|
||||||
$HOSTS{$_} = [ map { [ $_ ? (format_address $_->[0]) : '' ] }
|
$HOSTS{$_} = [ map { [ $_ ? (format_address $_->[0]) : '' ] }
|
||||||
@@ -136,6 +135,9 @@ sub hostnames_resolve_async {
|
|||||||
|
|
||||||
# Wait for the resolver to perform all resolutions
|
# Wait for the resolver to perform all resolutions
|
||||||
$done->recv;
|
$done->recv;
|
||||||
|
|
||||||
|
# Remove reference to resolver so that we close sockets
|
||||||
|
undef $AnyEvent::DNS::RESOLVER if $AnyEvent::DNS::RESOLVER;
|
||||||
|
|
||||||
return $ips;
|
return $ips;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user