Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Why might LWP::UserAgent be failing with '500 EOF'?

by ff (Hermit)
on Apr 18, 2006 at 04:11 UTC ( [id://543996]=note: print w/replies, xml ) Need Help??


in reply to Re: Why might LWP::UserAgent be failing with '500 EOF'?
in thread Why might LWP::UserAgent be failing with '500 EOF'?

Hi ikegami,

Thanks for the suggestion to look in file LWP/Protocol/http.pm. I started trying tricks with Dumper on various sections, and thinking and googling led to the posting of #14028: Bug (leak?) with IO::Select object creation?. There, the OP makes three different sockets and notices upon Dumping them that:

We create three IO::Select objects in the same way but each object is slightly bigger than the last. Surely each object should be the same size? The same behavior occurs on either Win32 or Solaris.
Graham Barr answers that
That is because IO::select uses the system file number of the handle passed to store the filehandle reference in an array. So the array object will be as big as the file number of the filehandle passed in.
Okay, please tell me I've misunderstood this, but suppose the file number of the filehandle passed in was "0", does that mean some kind of empty array object will be floating around causing my EOF problem? In fact, when I edit http.pm by duplicating the socket creation line, my program works, i.e.

my $socket = $self->_new_socket($host, $port, $timeout); $socket = $self->_new_socket($host, $port, $timeout); # my duplicat +ive line # such that $socket clobbers the 'my $socket' and so is not based + on "0"?

So, 1) what is Graham saying above, 2) why does my "fix" work, and 3) might there be a way to avoid altering the http.pm module? I suppose submitting this as a bug is the path I will tread.... Thanks.

Replies are listed 'Best First'.
Re^3: Why might LWP::UserAgent be failing with '500 EOF'?
by andylockran (Initiate) on May 17, 2010 at 09:36 UTC
    I realise this thread is quite old, however, the same problem and the same fix resolved the issue for me. ff - did you ever report this bug? Regards, Andy

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://543996]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-04-26 01:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found