# ----- Constants -----
use vars qw/
$DEBUGFORCED $NBOFLINESFORBENCHMARK $FRAMEWIDTH $NBOFLASTUPDATELOOKUPTOSAVE
-$LIMITFLUSH $NEWDAYVISITTIMEOUT $VISITTIMEOUT $NOTSORTEDRECORDTOLERANCE $MAXDIFFEXTRA
+$LIMITFLUSH $NEWDAYVISITTIMEOUT $VISITTIMEOUT $NOTSORTEDRECORDTOLERANCE
$WIDTHCOLICON $TOOLTIPON
$lastyearbeforeupdate
/;
$NBOFLASTUPDATELOOKUPTOSAVE=500; # Nb of records to save in DNS last update cache file
$LIMITFLUSH=5000; # Nb of records in data arrays after how we need to flush data on disk
$NEWDAYVISITTIMEOUT=764041; # Delay between 01-23:59:59 and 02-00:00:00
-$VISITTIMEOUT=10000; # Laps of time to consider a page load as a new visit. 10000 = 1 hour (Default = 10000)
-$NOTSORTEDRECORDTOLERANCE=10000; # Laps of time to accept a record if not in correct order. 10000 = 1 hour (Default = 10000)
-$MAXDIFFEXTRA=500;
+$VISITTIMEOUT=10000; # Lapse of time to consider a page load as a new visit. 10000 = 1 hour (Default = 10000)
+$NOTSORTEDRECORDTOLERANCE=10000; # Lapse of time to accept a record if not in correct order. 10000 = 1 hour (Default = 10000)
$WIDTHCOLICON=32;
$TOOLTIPON=0; # Tooltips plugin loaded
# ----- Running variables -----
$MaxLengthOfStoredUA
%BarPng
$BuildReportFormat
-$BuildHistoryFormat
+$BuildHistoryFormat
+$ExtraTrackedRowsLimit
/;
$StaticExt='html';
$DNSStaticCacheFile='dnscache.txt';
'he'=>'he.png','hx'=>'hx.png','vh'=>'vh.png','hh'=>'hh.png','vk'=>'vk.png','hk'=>'hk.png');
$BuildReportFormat='html';
$BuildHistoryFormat='text';
+$ExtraTrackedRowsLimit=500;
use vars qw/
$EnableLockForUpdate $DNSLookup $AllowAccessFromWebToAuthenticatedUsersOnly
$BarHeight $BarWidth $CreateDirDataIfNotExists $KeepBackupOfHistoricFiles
# Expires must be GMT ANSI asctime and must be after Content-type to avoid pb with some servers (SAMBAR)
if ($Expires =~ /^\d+$/) {
- print "Cache-Control: public\n";\r
- print "Last-Modified: ".gmtime($starttime)."\n";\r
- print "Expires: ".(gmtime($starttime+$Expires))."\n";\r
+ print "Cache-Control: public\n";
+ print "Last-Modified: ".gmtime($starttime)."\n";
+ print "Expires: ".(gmtime($starttime+$Expires))."\n";
}
print "\n";
}
@URLWithQueryWithout=split(/\s+/,$value);
next;
}
+
# Extra parameters
if ($param =~ /^ExtraSectionName(\d+)/) { $ExtraName[$1]=$value; next; }
if ($param =~ /^ExtraSectionCodeFilter(\d+)/) { @{$ExtraCodeFilter[$1]}=split(/\s+/,$value); next; }
if ($param =~ /^MinHitExtra(\d+)/) { $MinHitExtra[$1]=$value; next; }
# Special appearance parameters
if ($param =~ /^LoadPlugin/) { push @PluginsToLoad, $value; next; }
- # Other that we need to put after MaxNbOfExtra and MinHitExtra
+ # Other parameter checks we need to put after MaxNbOfExtra and MinHitExtra
if ($param =~ /^MaxNbOf(\w+)/) { $MaxNbOf{$1}=$value; next; }
if ($param =~ /^MinHit(\w+)/) { $MinHit{$1}=$value; next; }
# Check if this is a known parameter
if ($Debug) { debug("Config file read was \"$configFile\" (level $level)"); }
}
-
#------------------------------------------------------------------------------
# Function: Load the reference databases
# Parameters: List of files to load
push @INC, "$dir";
$DirAddedInINC{"$dir"}=1;
}
- my $loadret=0;\r
+ my $loadret=0;
my $modperl=$ENV{"MOD_PERL"}? eval { require mod_perl; $mod_perl::VERSION >= 1.99 ? 2 : 1 } : 0;
if ($modperl == 2) { $loadret=require "$pluginpath"; }
- else { $loadret=require "$pluginfile.pm"; }\r
+ else { $loadret=require "$pluginfile.pm"; }
if (! $loadret || $loadret =~ /^error/i) {
# Load failed, we stop here
$NBOFLINESFORBENCHMARK--;
if ($ENV{'GATEWAY_INTERFACE'}) { $DirCgi=''; }
if ($DirCgi && !($DirCgi =~ /\/$/) && !($DirCgi =~ /\\$/)) { $DirCgi .= '/'; }
-if (! $DirData || $DirData =~ /^\./) {\r
- if (! $DirData || $DirData eq '.') { $DirData="$DIR"; } # If not defined or chosen to '.' value then DirData is current dir\r
+if (! $DirData || $DirData =~ /^\./) {
+ if (! $DirData || $DirData eq '.') { $DirData="$DIR"; } # If not defined or chosen to '.' value then DirData is current dir
elsif ($DIR && $DIR ne '.') { $DirData="$DIR/$DirData"; }
-}\r
+}
$DirData||='.'; # If current dir not defined then we put it to '.'
$DirData =~ s/[\\\/]+$//;
# Define SiteToAnalyze and SiteToAnalyzeWithoutwww for regex operations
$YearRequired="$4";
$FileSuffix="$5";
# Correct DirData
- if (! $DirData || $DirData =~ /^\./) {\r
- if (! $DirData || $DirData eq '.') { $DirData="$DIR"; } # If not defined or chosen to '.' value then DirData is current dir\r
+ if (! $DirData || $DirData =~ /^\./) {
+ if (! $DirData || $DirData eq '.') { $DirData="$DIR"; } # If not defined or chosen to '.' value then DirData is current dir
elsif ($DIR && $DIR ne '.') { $DirData="$DIR/$DirData"; }
- }\r
+ }
$DirData||='.'; # If current dir not defined then we put it to '.'
$DirData =~ s/[\\\/]+$//;
print "Start migration for file '$MigrateStats'."; print $ENV{'GATEWAY_INTERFACE'}?"<br />\n":"\n";
if (${'_section_' . $extranum . '_l'}{$rowkeyval}||0 < $timerecord) { ${'_section_' . $extranum . '_l'}{$rowkeyval}=$timerecord; }
}
# Check to avoid too large extra sections
- if (scalar keys %{'_section_' . $extranum . '_h'} > $MAXDIFFEXTRA) {
- error("Too many (more than MAXDIFFEXTRA=$MAXDIFFEXTRA) different values for row keys of extra section $extranum. Are you sure you want to track an array with so many values (may be your ExtraSection setup is wrong) ? If yes, increase the MAXDIFFEXTRA constant in awstats.pl");
+ if (scalar keys %{'_section_' . $extranum . '_h'} > $ExtraTrackedRowsLimit) {
+ error(<<END_ERROR_TEXT);
+The number of values found for extra section $extranum has grown too large.
+In order prevent awstats from using an excessive amount of memory, the number
+of values is currently limited to $ExtraTrackedRowsLimit. Perhaps you should consider
+revising extract parameters for extra section $extranum. If you are certain you
+want to track such a large data set, you can increase the limit by setting
+ExtraTrackedRowsLimit in your awstats configuration file.
+END_ERROR_TEXT
}
}