ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/myhttpd/netgeo.pl
(Generate patch)

Comparing Coro/myhttpd/netgeo.pl (file contents):
Revision 1.12 by root, Tue Sep 10 04:37:44 2002 UTC vs.
Revision 1.13 by root, Sat Oct 5 09:04:03 2002 UTC

8use Coro; 8use Coro;
9use Coro::Event; 9use Coro::Event;
10use Coro::Semaphore; 10use Coro::Semaphore;
11use Coro::SemaphoreSet; 11use Coro::SemaphoreSet;
12use Coro::Socket; 12use Coro::Socket;
13use Coro::Timer;
13 14
14use BerkeleyDB; 15use BerkeleyDB;
15 16
16$Event::DIED = sub { 17$Event::DIED = sub {
17 Event::verbose_exception_handler(@_); 18 Event::verbose_exception_handler(@_);
83 $timeout *= 2; 84 $timeout *= 2;
84 $timeout = 1 if $timeout > 600; 85 $timeout = 1 if $timeout > 600;
85 } else { 86 } else {
86 last; 87 last;
87 } 88 }
89 } else {
90 # only retry once a minute
91 print STDERR "unable to connect to $self->{ip} ($self->{name}), retrying...\n";
92 Coro::Timer::sleep 60;
88 } 93 }
89 } 94 }
90 95
91 $netgeo::whois{$id} = $whois; 96 $netgeo::whois{$id} = $whois;
92 } 97 }
336 } 341 }
337 342
338 my ($arin, $ripe, $apnic); 343 my ($arin, $ripe, $apnic);
339 344
340 $whois = $WHOIS{RIPE}->ip_request($ip) 345 $whois = $WHOIS{RIPE}->ip_request($ip)
341 || $WHOIS{LACNIC}->ip_request($ip)
342 || $WHOIS{APNIC} ->ip_request($ip) 346 || $WHOIS{APNIC} ->ip_request($ip)
343 || $WHOIS{ARIN} ->ip_request($ip) 347 || $WHOIS{ARIN} ->ip_request($ip)
348 || $WHOIS{LACNIC}->ip_request($ip)
344 ; 349 ;
345 350
346 $whois =~ /^\*in: ([0-9.]+)\s+-\s+([0-9.]+)\s*$/mi 351 $whois =~ /^\*in: ([0-9.]+)\s+-\s+([0-9.]+)\s*$/mi
347 or do { warn "$whois($ip): no addresses found\n", last }; 352 or do { warn "$whois($ip): no addresses found\n", last };
348 353

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines