From 8122fcfb27626a56b8e084572342a30f3a23eea9 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Sun, 21 Apr 2013 12:14:27 -0400 Subject: [PATCH] Plugin: override dns_timeout by passing in a value --- lib/Qpsmtpd/Plugin.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Qpsmtpd/Plugin.pm b/lib/Qpsmtpd/Plugin.pm index d4be038..2d3537e 100644 --- a/lib/Qpsmtpd/Plugin.pm +++ b/lib/Qpsmtpd/Plugin.pm @@ -273,10 +273,10 @@ sub store_deferred_reject { sub init_resolver { my $self = shift; + my $timeout = $self->{_args}{dns_timeout} || shift || 5; return $self->{_resolver} if $self->{_resolver}; $self->log(LOGDEBUG, "initializing Net::DNS::Resolver"); $self->{_resolver} = Net::DNS::Resolver->new(dnsrch => 0); - my $timeout = $self->{_args}{dns_timeout} || 5; $self->{_resolver}->tcp_timeout($timeout); $self->{_resolver}->udp_timeout($timeout); return $self->{_resolver};