diff --git a/lib/Qpsmtpd/Base.pm b/lib/Qpsmtpd/Base.pm index 5d3e8faa..4a2da064 100644 --- a/lib/Qpsmtpd/Base.pm +++ b/lib/Qpsmtpd/Base.pm @@ -59,26 +59,6 @@ sub get_resolver { return $self->{_resolver}; } -sub get_async_resolver { - my ( $self, %args ) = @_; - return $self->{_async_resolver} if $self->{_async_resolver}; - - my $async_res; - eval 'use Net::DNS::Async'; - if ($@) { - warn "could not load Net::DNS::Async, is it installed?"; - return; - } - - my $res = Net::DNS::Resolver->new(dnsrch => 0); - $res->tcp_timeout(0); # Net::DNS::Async handles its own timeouts - $res->tcp_timeout(0); - - $self->{_async_resolver} = Net::DNS::Async->new( %args ); - $self->{_async_resolver}{Resolver} = $res; - return $self->{_async_resolver}; -} - sub resolve_a { my ($self, $name) = @_; my $q = $self->get_resolver->query($name, 'A') or return; diff --git a/t/qpsmtpd-base.t b/t/qpsmtpd-base.t index 20f5148e..2d443024 100644 --- a/t/qpsmtpd-base.t +++ b/t/qpsmtpd-base.t @@ -17,7 +17,6 @@ __tildeexp(); __is_localhost(); __is_valid_ip(); __get_resolver(); -__get_async_resolver(); __resolve_a(); __resolve_aaaa(); __resolve_mx(); @@ -63,14 +62,6 @@ sub __get_resolver { } -sub __get_async_resolver { - eval 'use Net::DNS::Async'; - return if ($@); - my $res = $base->get_async_resolver() or return; - isa_ok( $res, 'Net::DNS::Async', "resolver object, $res"); - isa_ok( $res->{Resolver}, 'Net::DNS::Resolver', "resolver object, $res"); -} - sub __resolve_a { my @r = $base->resolve_a('simerson.net'); ok(@r, "resolve_a: " . join(',', @r));