]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Fixed a bug when using %query or cs-query-string tag in LogFormat.
authoreldy <>
Fri, 1 Nov 2002 03:08:39 +0000 (03:08 +0000)
committereldy <>
Fri, 1 Nov 2002 03:08:39 +0000 (03:08 +0000)
Ignore bad http code for Microsoft Index Servers.

docs/awstats_changelog.txt
wwwroot/cgi-bin/awstats.pl

index 37e8c8c93455cd30f93de0c1a9d3f4409ce7378b..c894ac0676511b50cd202441a9e1351382d818a9 100644 (file)
@@ -8,7 +8,10 @@ AWStats Changelog
 - Removed "Bytes" text when values is 0.
 - Reduced main page size.
 - New parameter: Added OnlyHosts parameter.
-
+- Fixed a bug when using IIS and %query or cs-query-string tag in LogFormat
+  and URLWithQuery=1.
+- Records with bad http code for Microsoft Index Servers (on 1 digit instead
+  of 3) are no more reported as corrupted records.
 
 
 5.1
index 82fb4a49c88d92652f20fa2a88f1edca9d6dadf7..587108f0ad960c64dea8bcc6760f75118492cbf5 100644 (file)
@@ -4559,6 +4559,7 @@ if ($UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft') {  # Updat
                $LogFormatString =~ s/%{mod_gzip_output_size}n/%gzipout/g;
                $LogFormatString =~ s/%{mod_gzip_compression_ratio}n/%gzipratio/g;
                # Replacement for a IIS and ISA format string
+               $LogFormatString =~ s/cs-uri-query/%query/g;    # Must be before cs-uri
                $LogFormatString =~ s/date\stime/%time2/g;
                $LogFormatString =~ s/c-ip/%host/g;
                $LogFormatString =~ s/cs-username/%logname/g;
@@ -4569,7 +4570,6 @@ if ($UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft') {  # Updat
                $LogFormatString =~ s/cs-version/%other/g;              # Protocol
                $LogFormatString =~ s/cs\(User-Agent\)/%ua/g; $LogFormatString =~ s/c-agent/%ua/g;
                $LogFormatString =~ s/cs\(Referer\)/%referer/g; $LogFormatString =~ s/cs-referred/%referer/g;
-               $LogFormatString =~ s/cs-uri-query/%host/g;
                $LogFormatString =~ s/sc-authenticated/%other/g;
                $LogFormatString =~ s/s-svcname/%other/g;
                $LogFormatString =~ s/s-computername/%other/g;
@@ -4910,12 +4910,12 @@ if ($UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft') {        # Updat
                
                # Check return status code
                #-------------------------
-               if ($protocol == 1 || $protocol == 4) {         # HTTP record or Stream record
+               if ($protocol == 1 || $protocol == 4) {                 # HTTP record or Stream record
                        if ($ValidHTTPCodes{$field[$pos_code]}) {       # Code is valid
                                if ($field[$pos_code] == 304) { $field[$pos_size]=0; }
                        }
                        else {                                                                          # Code is not valid
-                               if ($field[$pos_code] =~ /^\d\d\d$/) {                                  # Keep error code and next
+                               if ($field[$pos_code] =~ /^\d\d\d$/) {  # Keep error code and next
                                        $_errors_h{$field[$pos_code]}++;
                                        $_errors_k{$field[$pos_code]}+=int($field[$pos_size]);
                                        foreach my $code (keys %TrapInfosForHTTPErrorCodes) {
@@ -4923,14 +4923,17 @@ if ($UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft') {        # Updat
                                        }
                                        next;
                                }
-                               else {                                                                                                  # Bad format record (should not happen but when using MSIndex server), next
-                                       $NbOfLinesCorrupted++; $NbOfNewLines--;
-                                       if ($ShowCorrupted) { print "Corrupted record (HTTP code not on 3 digits): $_\n"; }
-                                       next;
+                               else {                                                                  # Bad format record (should not happen but when using MSIndex server), next
+                                       # Second test avoid error when using MS IndexServer that returns non standard HTTP code on 1 char
+                                       if ($field[$pos_code] !~ /^\d$/) { 
+                                               $NbOfLinesCorrupted++; $NbOfNewLines--;
+                                               if ($ShowCorrupted) { print "Corrupted record (HTTP code not on 3 digits): $_\n"; }
+                                               next;
+                                       }
                                }
                        }
                }
-               elsif ($protocol == 3) {                                        # SMTP record
+               elsif ($protocol == 3) {                                                # SMTP record
                        if ($field[$pos_code] != 1) {                           # Code is not valid
                                $field[$pos_size]=0;
                                $_errors_h{$field[$pos_code]}++;