[interchange-cvs] interchange - heins modified 2 files
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Mon Oct 31 10:13:10 EST 2005
User: heins
Date: 2005-10-31 15:13:10 GMT
Modified: lib/Vend Dispatch.pm Error.pm
Log:
* Make robot errors going to the log less verbose, and make it possible to route
them to a separate log with:
ErrorDestination <<EOF
'WARNING: POSSIBLE BAD ROBOT. %s accesses with no 30 second pause.' logs/robots.log
'Too many IDs, %d hour wait enforced.' logs/robots.log
EOF
Revision Changes Path
1.60 +8 -4 interchange/lib/Vend/Dispatch.pm
rev 1.60, prev_rev 1.59
Index: Dispatch.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Dispatch.pm,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- Dispatch.pm 19 Oct 2005 14:15:43 -0000 1.59
+++ Dispatch.pm 31 Oct 2005 15:13:09 -0000 1.60
@@ -1,6 +1,6 @@
# Vend::Dispatch - Handle Interchange page requests
#
-# $Id: Dispatch.pm,v 1.59 2005/10/19 14:15:43 mheins Exp $
+# $Id: Dispatch.pm,v 1.60 2005/10/31 15:13:09 mheins Exp $
#
# Copyright (C) 2002-2005 Interchange Development Group
# Copyright (C) 2002 Mike Heins <mike at perusion.net>
@@ -26,7 +26,7 @@
package Vend::Dispatch;
use vars qw($VERSION);
-$VERSION = substr(q$Revision: 1.59 $, 10);
+$VERSION = substr(q$Revision: 1.60 $, 10);
use POSIX qw(strftime);
use Vend::Util;
@@ -1343,7 +1343,8 @@
"WARNING: POSSIBLE BAD ROBOT. %s accesses with no 30 second pause.",
$Vend::Session->{accesses},
);
- do_lockout($msg);
+ ::logError($msg);
+ do_lockout();
}
}
}
@@ -1360,7 +1361,10 @@
before trying again. Only waiting that period will allow access. Terminating.
EOF
$msg = get_locale_message(403, $msg);
- do_lockout($msg);
+ do_lockout();
+
+ ::logError('Too many IDs, %d hour wait enforced.', $wait);
+
$Vend::StatusLine = <<EOF;
Status: 403 Forbidden
Content-Type: text/plain
2.9 +4 -4 interchange/lib/Vend/Error.pm
rev 2.9, prev_rev 2.8
Index: Error.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Error.pm,v
retrieving revision 2.8
retrieving revision 2.9
diff -u -r2.8 -r2.9
--- Error.pm 30 Jan 2004 17:35:03 -0000 2.8
+++ Error.pm 31 Oct 2005 15:13:10 -0000 2.9
@@ -1,6 +1,6 @@
# Vend::Error - Handle Interchange error pages and messages
#
-# $Id: Error.pm,v 2.8 2004/01/30 17:35:03 mheins Exp $
+# $Id: Error.pm,v 2.9 2005/10/31 15:13:10 mheins Exp $
#
# Copyright (C) 2002-2003 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -38,7 +38,7 @@
use vars qw/$VERSION/;
-$VERSION = substr(q$Revision: 2.8 $, 10);
+$VERSION = substr(q$Revision: 2.9 $, 10);
sub get_locale_message {
my ($code, $message, @arg) = @_;
@@ -155,7 +155,7 @@
sub do_lockout {
my ($cmd);
- my $msg = shift || '';
+ my $msg = '';
if($cmd = $Global::LockoutCommand) {
my $host = $CGI::remote_addr;
$cmd =~ s/%s/$host/ or $cmd .= " $host";
@@ -166,7 +166,7 @@
logGlobal({level => 'notice'}, $msg);
}
$Vend::Cfg->{VendURL} = $Vend::Cfg->{SecureURL} = 'http://127.0.0.1';
- logError($msg);
+ logError($msg) if $msg;
}
1;
More information about the interchange-cvs
mailing list