Lines 178-186
Link Here
|
178 |
$ent->{start_time} = $now if !defined $ent->{start_time}; |
178 |
$ent->{start_time} = $now if !defined $ent->{start_time}; |
179 |
|
179 |
|
|
|
180 |
# are there any applicable per-zone settings? |
181 |
my $zone = $ent->{zone}; |
182 |
my $settings; # a ref to a by-zone or to global settings |
183 |
my $conf_by_zone = $self->{main}->{conf}->{by_zone}; |
184 |
if (defined $zone && $conf_by_zone) { |
185 |
# dbg("async: searching for by_zone settings for $zone"); |
186 |
$zone =~ s/^\.//; $zone =~ s/\.\z//; # strip leading and trailing dot |
187 |
for (;;) { # 2.10.example.com, 10.example.com, example.com, com, '' |
188 |
if (exists $conf_by_zone->{$zone}) { |
189 |
$settings = $conf_by_zone->{$zone}; |
190 |
dbg("async: applying by_zone settings for $zone"); |
191 |
last; |
192 |
} elsif ($zone eq '') { |
193 |
last; |
194 |
} else { # strip one level, careful with address literals |
195 |
$zone = ($zone =~ /^( (?: [^.] | \[ (?: \\. | [^\]\\] )* \] )* ) |
196 |
\. (.*) \z/xs) ? $2 : ''; |
197 |
} |
198 |
} |
199 |
} |
200 |
|
180 |
my $t_init = $ent->{timeout_initial}; # application-specified has precedence |
201 |
my $t_init = $ent->{timeout_initial}; # application-specified has precedence |
|
|
202 |
$t_init = $settings->{rbl_timeout} if $settings && !defined $t_init; |
181 |
$t_init = $self->{main}->{conf}->{rbl_timeout} if !defined $t_init; |
203 |
$t_init = $self->{main}->{conf}->{rbl_timeout} if !defined $t_init; |
182 |
$t_init = 0 if !defined $t_init; # last-resort default, just in case |
204 |
$t_init = 0 if !defined $t_init; # last-resort default, just in case |
183 |
|
205 |
|
184 |
my $t_end = $ent->{timeout_min}; # application-specified has precedence |
206 |
my $t_end = $ent->{timeout_min}; # application-specified has precedence |
|
|
207 |
$t_end = $settings->{rbl_timeout_min} if $settings && !defined $t_end; |
185 |
$t_end = 0.2 * $t_init if !defined $t_end; |
208 |
$t_end = 0.2 * $t_init if !defined $t_end; |
186 |
$t_end = 0 if $t_end < 0; # just in case |
209 |
$t_end = 0 if $t_end < 0; # just in case |