]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Modified script to avoid downloading large binary files that have not
authoreldy <>
Mon, 2 Jun 2003 17:32:42 +0000 (17:32 +0000)
committereldy <>
Mon, 2 Jun 2003 17:32:42 +0000 (17:32 +0000)
title.

tools/urlaliasbuilder.pl

index 51973caa7985aa8c64765fc912ba32f326c4a61f..2b2ad5251c383a383b6f48c1b0dbfa9a3f778424 100644 (file)
@@ -47,6 +47,8 @@ my $getTimeOut = 2;
 my $proxyServer = "";\r
 # Hosts not to use a proxy for\r
 my @hostsNoProxy = ("host1","host1.my.domain.name");\r
+# Make sure we don't download multi-megabyte files! We need only head section\r
+my $maxDocSizeBytes = 4096; # number is bytes\r
 \r
 ############### DON'T EDIT BELOW HERE ###############\r
 \r
@@ -111,12 +113,12 @@ if ($nohosts || $helpfound || ! @ARGV) {
        print "    If this file is an AWStats history file then urlaliasbuilder will use the\n";\r
        print "    SIDER section of this file as its input URL's list.\n";\r
        print "  -urlaliasfile=Output urlalias file to build\n";\r
-       print "  -overwrite\n";\r
-       print "  -secure\n";\r
+       print "  -overwrite    Overwrite output file if exists\n";\r
+       print "  -secure       Use https protocol\n";\r
        print "\n";\r
        print "Example: $PROG.$Extension -site=www.someotherhost.com\n";\r
        print "\n";\r
-       print "This is default configuration used if no option is used on command line:\n";\r
+       print "This is default configuration used when no option are provided on command line:\n";\r
        print "Input urllist file: $fileToOpen (overwritten by -urllistfile option)\n";\r
        print "Output urlalias file: $urlAliasFile (overwritten by -urlaliasfile option)\n";\r
        print "\n";     \r
@@ -234,6 +236,8 @@ if ($proxyServer) {
        # avoid proxy for these hosts\r
        $ua->no_proxy(@hostsNoProxy);\r
 }\r
+# set maximum size of document to retrieve (in bytes)\r
+$ua->max_size($maxDocSizeBytes);\r
 if(!($ua->is_protocol_supported('https')) && $useHTTPS) {\r
        print "SSL is not supported on this machine.\n\n";\r
        exit();\r