Close socket upon completion of async DNS resolution
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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]) : '' ] }
|
||||
@@ -137,6 +136,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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user