Subject: | Warning from Net::DNS for bogus redirect |
In some cases, a bad Location: header in a redirect (with a bogus
too-long hostname) will cause Net::DNS to issue a warning:
de|wipeadclick=201002263072+-+Kopfbanner/2010/Sutter/Diverse/Br...
truncated to 63 octets (RFC1035 2.3.1) at
/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/Net/DNS/Question.pm
line 237
With older versions of DNS::Question (< 0.60), this produced a croak
instead of a carp.
This is with the following versions:
POE: 1.292
POE::Component::Client::HTTP: 0.895
POE::Component::Client::DNS: 1.051
Net::DNS: 0.66
on Perl:
This is perl, v5.8.8 built for x86_64-linux-thread-multi
and uname -a:
Linux dev05.rnd.dev.corp.oversee.net 2.6.18-164.11.1.el5 #1 SMP Wed
Jan 20 07:32:21 EST 2010 x86_64 x86_64 x86_64 GNU/Linux
Subject: | crawl.pl |
#!/usr/bin/perl
use POE qw(Component::Client::HTTP);
use HTTP::Request::Common qw(GET);
my @urls = (
'http://example.com/',
'http://dasoertliche.4call.de/wipe/adjump/?http://www.brot-fuer-die-welt.de|wipeadclick=201002263072+-+Kopfbanner%2F2010%2FSutter%2FDiverse%2FBrot+f%FCr+die+Welt',
);
POE::Session->create(
inline_states => {
_start => sub {
POE::Component::Client::HTTP->spawn(
Alias => 'ua',
FollowRedirects => 3,
);
$poe_kernel->sig(DIE => 'die');
foreach my $url (@urls) {
print "Requesting $url\n";
$poe_kernel->post('ua', 'request', 'response', GET $url);
}
},
response => sub {
my ($req, $resp) = @_[ARG0, ARG1];
print 'Got ', $req->[0]->uri, ' ', $resp->[0]->status_line, "\n";
},
die => sub {
my ($error_str, $dest_session, $event, $source_session,
$from_state, $file, $line)
= @{$_[ARG1]}{
qw(error_str dest_session event source_session
from_state file line)
};
print "Died: $error_str";
print "File: $file, Line $line\n";
print "Event: $event, From state: $from_state\n";
print 'Dest session: ', $dest_session->ID, "\n";
print 'Source Session: ', $source_session->ID, "\n";
},
},
);
$poe_kernel->run();