LWP::UserAgent infinite hang

Discussion in 'Perl Misc' started by Tomek, Mar 5, 2007.

  1. Tomek

    Tomek Guest

    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;
    Tomek, Mar 5, 2007
    #1
    1. Advertising

  2. Tomek

    Mumia W. Guest

    On 03/05/2007 05:18 PM, Tomek wrote:
    > 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.
    Mumia W., Mar 6, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. La Jesus
    Replies:
    9
    Views:
    1,314
    Gunnar Hjalmarsson
    Oct 27, 2003
  2. Chandra

    Problem with LWP::USERAGENT

    Chandra, Feb 25, 2004, in forum: Perl
    Replies:
    0
    Views:
    497
    Chandra
    Feb 25, 2004
  3. Vinay Gupta
    Replies:
    2
    Views:
    1,107
    Michael Schlenker
    Jul 27, 2004
  4. Playker
    Replies:
    0
    Views:
    509
    Playker
    Feb 24, 2005
  5. Replies:
    13
    Views:
    2,741
    Arne Vajhøj
    Mar 18, 2008
Loading...

Share This Page