empty response with Parallel UserAgent
Bruno Semrau (bsemrau@nuernberg.netsurf.de)
Wed, 4 Aug 1999 22:59:53 +0200 (CEST)
Hello,
i have written a script to check URLs.
With a few Urls it works fine, but if i have many URLs (over 100) to
check, the response was empty.
the URLs have the form
http://username:password@www.test.com/secure/
Here is the short form of my script:
#!/usr/bin/perl
use LWP::Parallel::UserAgent;
use HTTP::Request;
my $pua = new LWP::Parallel::UserAgent;
$pua->timeout (20);
$pua->max_req ( 2);
$pua->max_hosts(5);
$pua->redirect(0);
$pua->in_order (1);
open(FILE, "links")|| die "$!\n";;
foreach (<FILE>) {
chomp;
my $req = HTTP::Request->new('HEAD', $_);
print "Registering '".$req->url."'\n";
$pua->register ($req , \&handle_answer);
}
close(FILE);
my $entries = $pua->wait();
foreach (keys %$entries) {
my $res = $entries->{$_}->response;
print "Answer for '",$res->request->url, "' was \t", $res->code,": ",
$res->message,"\n";
}
thx
Bruno