It looks like the remote end is sending a Unicode BOM (byte order mark) at the beginning of the stream, at a guess. Which is a bit naughty, because the headers didn't specify that it was going to be a UTF-8 stream. However this might be unrelated to the bug.

Take that ethereal dump, see if you can work it into a test case for LWP, and submit it as a bug to the maintainer. Make sure you include a working one for comparison, too.

This might involve a simple Test server, if you can't figure out how to test just the response processing component; this little script can do the trick; it takes two arguments: the response file to issue, and where to save the request that it read.

use IO::All; my $response = shift; my $target = shift; my $server = io(":9207"); $server->autoclose(0); my $sock = $server->accept; $sock->autoclose(0); my $doc; while (my $line = $sock->readline) { last if $line =~ m/\A\r?\n\Z/; $doc .= $line; } { $doc > io($target)->assert; } $sock->print(io($response)->slurp); $sock->shutdown; # and it was over ... before it began exit(0);
$h=$ENV{HOME};my@q=split/\n\n/,`cat $h/.quotes`;$s="$h/." ."signature";$t=`cat $s`;print$t,"\n",$q[rand($#q)],"\n";

In reply to Re: Problem with Dot NET and LWP by mugwumpjism
in thread Problem with Dot NET and LWP by enemyofthestate

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.