LWP::UserAgent infinite hang

T

Tomek

Hello!

I use Perl 5.8.8 and newest LWP.

Recently, I encountered some weird behavior using LWP::UserAgent. LWP
makes 100% CPU time with this
simple script and hangs up. Seems remote server is
sending bad HTTP response, is there a way to solve it ?

adding $ua->max_size(xx) doesn't help.

If you have any idea how to solve that please tell me..


Best regards, Tomasz Kraus

Error can be reproduced with code:

#!/usr/local/bin/perl
use strict;
use LWP::UserAgent;
my $ua=new LWP::UserAgent;
$ua->timeout(30);
$ua->agent("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET
CLR 1.1.4322)");
push @{ $ua->requests_redirectable }, 'POST';
my
$resp=$ua->get('http://cod.menofgod.us/user.php?op=register&module=NS-NewUser');
if ($resp->is_success) {
print $resp->content;
}
print $resp->content;
 
M

Mumia W.

Hello!

I use Perl 5.8.8 and newest LWP.

Recently, I encountered some weird behavior using LWP::UserAgent. LWP
makes 100% CPU time with this
simple script and hangs up. Seems remote server is
sending bad HTTP response, is there a way to solve it ?

adding $ua->max_size(xx) doesn't help.

If you have any idea how to solve that please tell me..


Best regards, Tomasz Kraus

Error can be reproduced with code:

#!/usr/local/bin/perl
use strict;
use LWP::UserAgent;
my $ua=new LWP::UserAgent;
$ua->timeout(30);
$ua->agent("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET
CLR 1.1.4322)");
push @{ $ua->requests_redirectable }, 'POST';
my
$resp=$ua->get('http://cod.menofgod.us/user.php?op=register&module=NS-NewUser');

if ($resp->is_success) {
print $resp->content;
}
print $resp->content;

Perhaps it's a defense mechanism. Most websites take a dim view of
people using automated methods to create potentially hundreds of user
accounts.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top