1 |
--- smeserver-affa-0.10.0/root/sbin/e-smith/affa.DNS_Timeout 2008-03-10 18:41:52.000000000 +0100 |
2 |
+++ smeserver-affa-0.10.0/root/sbin/e-smith/affa 2008-03-11 09:55:26.000000000 +0100 |
3 |
@@ -635,15 +635,23 @@ |
4 |
|
5 |
# check for remoteHostName==localhost using DNS |
6 |
my $res = Net::DNS::Resolver->new; |
7 |
- my $query = $res->search($job{'remoteHostName'}); |
8 |
- if ($query) |
9 |
+ $res->udp_timeout(10); |
10 |
+ if( $job{'remoteHostName'} ne 'localhost' ) |
11 |
{ |
12 |
- foreach my $rr ($query->answer) |
13 |
+ my $query = $res->search($job{'remoteHostName'}); |
14 |
+ if ($query) |
15 |
{ |
16 |
- next unless $rr->type eq "A"; |
17 |
- $job{'remoteHostName'}='localhost' if( $rr->address eq $LocalIP ); |
18 |
- } |
19 |
- } |
20 |
+ foreach my $rr ($query->answer) |
21 |
+ { |
22 |
+ next unless $rr->type eq "A"; |
23 |
+ $job{'remoteHostName'}='localhost' if( $rr->address eq $LocalIP ); |
24 |
+ } |
25 |
+ } |
26 |
+ else |
27 |
+ { |
28 |
+ lg('Warning: DNS resolver timeout'); |
29 |
+ } |
30 |
+ } |
31 |
# check for remoteHostName==localhost using e-smith DB |
32 |
if( $job{'remoteHostName'} =~ /^(127.0.0.1|$LocalIP|$SystemName|$SystemName\.$DomainName)$/ ) |
33 |
{ |