Re: [Testcase][Patch] http protocol
Rocco Caputo (troc@netrus.net)
Fri, 08 Jan 99 12:54:06 -0500
On Fri, 08 Jan 1999 08:48:31 -0800, Roy T. Fielding wrote:
>>1. At least one system still reads POST data by lines instead of by
>>Content-Length. This leads to "it works in the browser but doesn't in
>>LWP" behavior. The patch appends an "invisible" $CRLF (not accounted
>>for in Content-Length) to content if a trailing $CRLF isn't present.
>
>What braindead system would that be?
That would be the braindead system visited by the test case. :)
If the previous patch tastes bad, try this one instead.
--- http.pm.orig Thu Nov 19 16:45:00 1998
+++ http.pm Fri Jan 8 12:45:08 1999
@@ -140,8 +140,9 @@ sub request
die "write timeout" if $timeout && !$sel->can_write($timeout);
$n = $socket->syswrite($$cont_ref, length($$cont_ref));
die $! unless defined($n);
+ shutdown($socket, 1);
die "short write" unless $n == length($$cont_ref);
- LWP::Debug::conns($buf);
+ LWP::Debug::conns($$cont_ref);
}
# read response line from server
__END__
-- Rocco Caputo / troc@netrus.net