Subject: | pipelined response deadlock |
Date: | Fri, 4 Jan 2013 15:21:08 +0000 |
To: | bug-libwww-perl [...] rt.cpan.org |
From: | Zefram <zefram [...] fysh.org> |
LWP::Protocol::http has some logic to abort sending a request body if
it's received the entire response header already. It assumes that the
server has a complete response that doesn't depend on any part of the
request body. It breaks if the server is only able to send the headers
early and will need to see the request body in order to generate the
response body.
Obviously that's an unusual condition. RFC 2616 doesn't explicitly
address this form of pipelining, but section 8.1.1 does say "HTTP requests
and responses can be pipelined on a connection", which could be construed
as general permission. The failure mode is somewhat nasty: because LWP
just stops sending data, and doesn't close that half of the connection,
the server and LWP are liable to wait for each other indefinitely.
This failure actually arises, subject to a race condition, in the test
suite for mod_perl.
Attached patch fixes, trivially, by dropping that branch of the code.
Note that the similar logic to abort if the server closes the connection
remains. That will presumably take effect in many of the situations
that the removed logic was trying to address.
-zefram
Message body is not shown because sender requested not to inline it.