Skip to content

Commit

Permalink
remove more async
Browse files Browse the repository at this point in the history
  • Loading branch information
msimerson committed Mar 12, 2024
1 parent 966e06d commit 10b26eb
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
20 changes: 0 additions & 20 deletions lib/Qpsmtpd/Base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 0 additions & 9 deletions t/qpsmtpd-base.t
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ __tildeexp();
__is_localhost();
__is_valid_ip();
__get_resolver();
__get_async_resolver();
__resolve_a();
__resolve_aaaa();
__resolve_mx();
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 10b26eb

Please sign in to comment.