From d42f10804ab7a73d33d5e17cc84767575a874d16 Mon Sep 17 00:00:00 2001 From: Gilles Darold Date: Fri, 6 Nov 2020 07:18:12 +0100 Subject: [PATCH] Change DNSLookupTimeout unit, must now be set in milliseconds. Thanks to Jo Deref fotr the report. --- README | 6 +++--- SquidAnalyzer.pm | 4 ++-- doc/SquidAnalyzer.pod | 5 +++-- etc/squidanalyzer.conf | 5 +++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README b/README index 37990f7..bebfda2 100644 --- a/README +++ b/README @@ -330,11 +330,11 @@ CONFIGURATION DNS name instead. Note that you must have a working DNS resolution and that it can really slow down the generation of reports. - DNSLookupTimeout 0.0001 + DNSLookupTimeout 100 If you have enabled UseClientDNSName and have lot of ip addresses that do not resolve you may want to increase the DNS lookup timeout. - By default SquidAnalyzer will stop to lookup a DNS name after 0.0001 - second (100 ms). + By default SquidAnalyzer will stop to lookup a DNS name after 100 + ms. The value must be set in millisecond. StoreUserIp 0 Store and show user different ip addresses used along the time in diff --git a/SquidAnalyzer.pm b/SquidAnalyzer.pm index 9f3d9fb..0bfb71c 100644 --- a/SquidAnalyzer.pm +++ b/SquidAnalyzer.pm @@ -1630,8 +1630,8 @@ sub _init $self->{with_month_stat} = 0; $self->{no_week_stat} = 0; $self->{UseClientDNSName} = $options{UseClientDNSName} || 0; - $self->{DNSLookupTimeout} = $options{DNSLookupTimeout} || 0.0001; - $self->{DNSLookupTimeout} = int($self->{DNSLookupTimeout} * 1000000); + $self->{DNSLookupTimeout} = $options{DNSLookupTimeout} || 100; + $self->{DNSLookupTimeout} = int($self->{DNSLookupTimeout} * 1000); $self->{LogFile} = (); $self->{queue_size} = 1; $self->{running_pids} = (); diff --git a/doc/SquidAnalyzer.pod b/doc/SquidAnalyzer.pod index e3f9a0e..e5f089e 100644 --- a/doc/SquidAnalyzer.pod +++ b/doc/SquidAnalyzer.pod @@ -340,11 +340,12 @@ the client ip address, this allow you to use the DNS name instead. Note that you must have a working DNS resolution and that it can really slow down the generation of reports. -=item DNSLookupTimeout 0.0001 +=item DNSLookupTimeout 100 If you have enabled UseClientDNSName and have lot of ip addresses that do not resolve you may want to increase the DNS lookup timeout. By default -SquidAnalyzer will stop to lookup a DNS name after 0.0001 second (100 ms). +SquidAnalyzer will stop to lookup a DNS name after 100 ms. The value must +be set in millisecond. =item StoreUserIp 0 diff --git a/etc/squidanalyzer.conf b/etc/squidanalyzer.conf index 102fc59..ee237a4 100644 --- a/etc/squidanalyzer.conf +++ b/etc/squidanalyzer.conf @@ -22,8 +22,9 @@ UseClientDNSName 0 # If you have enabled UseClientDNSName and have lot of ip addresses that do # not resolve you may want to increase the DNS lookup timeout. By default -# SquidAnalyzer will stop to lookup a DNS name after 0.0001 second (100 ms). -DNSLookupTimeout 0.0001 +# SquidAnalyzer will stop to lookup a DNS name after 100 ms. The value must +# be set in millisecond. +DNSLookupTimeout 100 # Set the file containing network alias name. Network are # show as Ip addresses so if you want to display name instead