If
all else fails you can always add my patches by hand to Jay's
MTBlPost.pm and MTBlPing.pm files. Here, for instance, is my
patch for trackback throttlingCODE
--- lib/MT/App/Trackback.pm.orig Thu Jan 15 17:41:46 2004
+++ lib/MT/App/Trackback.pm Mon Jan 19 11:11:16 2004
@@ -157,6 +157,38 @@
$app->translate("You are not allowed to send TrackBack pings."));
}
}
+## Do some simple throttling
+ my @ts = MT::Util::offset_time_list(time - 3599, $tb->blog_id);
+ my $from = sprintf("%04d%02d%02d%02d%02d%02d",
+ $ts[5]+1900, $ts[4]+1, @ts[3,2,1,0]);
+
+ my $count = MT::TBPing->count({ created_on => [$from] },
+ { range => {created_on => 1}});
+ my $maxpings = 20;
+ if ($count >= $maxpings)
+ {
+ $app->log("Throttled comment. Limit of $maxpings trackbacks in the last hour.");
+ return $app->_response(Error =>"Too many Trackbacks
+have been posted in the last hour. Someone may be crapflooding this
+blog. Or we may just have become insanely popular. Either way, please
+try your Trackback again later. Sorry.");
+ }
+ @ts = MT::Util::offset_time_list(time - 86399, $tb->blog_id);
+ $from = sprintf("%04d%02d%02d%02d%02d%02d",
+ $ts[5]+1900, $ts[4]+1, @ts[3,2,1,0]);
+
+ $count = MT::TBPing->count({ created_on => [$from] },
+ { range => {created_on => 1}});
+ $maxpings = 100;
+ if ($count >= $maxpings)
+ {
+ $app->log("Throttled comment. Limit of $maxpings Trackbacks in the last day.");
+ return $app->_response(Error => "Too many Trackbacks
+have been posted in the past 24 hours. Someone may be crapflooding this
+blog. Or we may just have become insanely popular. Either way, please
+try your Trackback again later. Sorry.");
+ }
+
## Check if user has pinged recently
#my @past = MT::TBPing->load({ tb_id => $tb_id, ip => $host_ip });
The lines with the "+" in front of them are lines you are supposed to
add (lines with "-" in front of them are lines you are supposed to delete). The patch file give the approximate location of each change (at least in
lib/MT/App/Tracback.pm, the change is around line 157; maybe different in Jay's file) and three lines of context around the modifications.
Patch files are designed to be processed automatically by the commandline program,
patch. But if that doesn't work for you, they
are human-readable.