perl/modules/W3C/LogValidator/lib/W3C LogValidator.pm,1.24,1.25

Update of /sources/public/perl/modules/W3C/LogValidator/lib/W3C
In directory hutz:/tmp/cvs-serv20293

Modified Files:
	LogValidator.pm 
Log Message:
The ExcludeHost feature didn't seem to actually exclude the records that were matched.
Patching the code to make the exclusion code not as fast, but now it seems to work.



Index: LogValidator.pm
===================================================================
RCS file: /sources/public/perl/modules/W3C/LogValidator/lib/W3C/LogValidator.pm,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- LogValidator.pm	18 Nov 2008 16:04:17 -0000	1.24
+++ LogValidator.pm	18 Nov 2008 16:49:57 -0000	1.25
@@ -262,6 +262,7 @@
 	my $allskiphosts = ($config{LogProcessor}{ExcludeHosts}) ? $config{LogProcessor}{ExcludeHosts} : ""; # default to none
 	my @skiphostsregex = split(" ", $allskiphosts);
 	my $entriescounter=0;
+	my $skip_thishost = 0;
 	if (@_)
 	{
 		my $logfile = shift;
@@ -279,12 +280,13 @@
 					my $tmp_record_remote_addr = $self->find_remote_addr($tmp_record, $logtype);
 					if ($tmp_record_remote_addr) # not a blank remote host or address
 					{
+					        $skip_thishost = 0;
 						foreach my $skipexpression (@skiphostsregex)
 						{
 						     if( $tmp_record_remote_addr =~ /$skipexpression/ )
 						     {
 							print " Skipping " . $tmp_record_remote_addr . " because it matches the ExcludeHosts pattern " . $skipexpression. "\n" if ($verbose > 2);
-							next;
+							$skip_thishost = 1;
 						     }
 						}
 					}
@@ -294,7 +296,9 @@
 					my $tmp_record_mime_type = $self->find_mime_type($tmp_record, $logtype);
 					my $tmp_record_HTTP_code = $self->find_HTTP_code($tmp_record, $logtype);
 					my $tmp_record_referer = $self->find_referer($tmp_record, $logtype);
-					if ( 
+					if (
+					  ($skip_thishost == 0) 
+					and
 					  ($tmp_record_HTTP_method eq "GET") 
 					and 
 					  ($self->no_cgi($tmp_record) or ($config{LogProcessor}{ExcludeCGI} eq 0))

Received on Tuesday, 18 November 2008 16:50:09 UTC