summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatarWilliam Heimbigner <william.heimbigner@gmail.com>2014-04-24 06:28:42 +0400
committerLibravatarWilliam Heimbigner <william.heimbigner@gmail.com>2014-04-24 06:28:42 +0400
commit9e47587396d4bd6f25a7f6eb1892eff084185533 (patch)
treee4756c2492b342aabdd7dfcb9b42e5841bf9919c
parentb050ebc6bc0ddb4eebd4afd6fd8b28cb6cafe995 (diff)
Fixed the urlcrunch detection rule
-rw-r--r--modules/event.pl18
-rw-r--r--modules/inspect.pl1
2 files changed, 9 insertions, 10 deletions
diff --git a/modules/event.pl b/modules/event.pl
index d3e3fa5..4978432 100644
--- a/modules/event.pl
+++ b/modules/event.pl
@@ -338,15 +338,15 @@ sub on_public
$::sc{lc $event->{to}->[0]}{users}{lc $event->{nick}}{msgtime} = time;
$::log->logg( $event );
$::db->logg( $event );
-# if ($event->{args}->[0] =~ /(https?:\/\/bitly.com\/\w+)|(https?:\/\/bit.ly\/\w+)|(https?:\/\/j.mp\/\w+)/i) {
-# my $reqid = $::async->add( HTTP::Request->new( GET => $1 ) );
-# $::httpRequests{$reqid} = $event;
-# my ($response, $id) = $::async->wait_for_next_response( 1 );
-# if (defined($response)) {
-# on_httpResponse($conn, $id, $response);
-# }
-# else { $conn->schedule( 1, sub { checkHTTP($conn); } ); }
-# }
+ if ($event->{args}->[0] =~ /(https?:\/\/bitly.com\/\w+|https?:\/\/bit.ly\/\w+|https?:\/\/j.mp\/\w+)/i) {
+ my $reqid = $::async->add( HTTP::Request->new( GET => $1 ) );
+ $::httpRequests{$reqid} = $event;
+ my ($response, $id) = $::async->wait_for_next_response( 1 );
+ if (defined($response)) {
+ on_httpResponse($conn, $id, $response);
+ }
+ else { $conn->schedule( 1, sub { checkHTTP($conn); } ); }
+ }
$::inspector->inspect( $conn, $event );
$::commander->command( $conn, $event );
}
diff --git a/modules/inspect.pl b/modules/inspect.pl
index f5914cb..5c7ce73 100644
--- a/modules/inspect.pl
+++ b/modules/inspect.pl
@@ -44,7 +44,6 @@ sub inspect {
next unless ( grep { $event->{type} eq $_ } split(/[,:; ]+/, $aonx{$id}{type}) );
next if ($aonx{$id}{class} eq 'dnsbl') && ($event->{host} =~ /(fastwebnet\.it|fastres\.net)$/); #this is a bad hack
if (defined($response)) {
- print Dumper($response);
if ($aonx{$id}{class} ne 'urlcrunch') { next; } #don't run our regular checks if this is being called from a URL checking function
else { $xresult = $::classes->check($aonx{$id}{class}, $aonx{$id}, $id, $event, $chan, $response); }
}