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.


In reply to Re^2: Why might LWP::UserAgent be failing with '500 EOF'? by ff
in thread Why might LWP::UserAgent be failing with '500 EOF'? by ff

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.