Paramiko throws EOFError rather than returning a 0 length file or ENOENT
Robert Collins
robertc at robertcollins.net
Thu Sep 14 02:32:49 BST 2006
On Wed, 2006-09-13 at 09:37 +0200, Vincent Ladeuil wrote:
>
> Yes it can. But I was a bit vague, I'll try to clarify for the
> urllib2/httplib context which happen to be *our* case:
>
> - httplib implements a pipelining of request/responses, so in
> theory, you could issue a second request while processing the
> first response, that means you should guard, not only against
> short reads but also against too long reads (i.e. you MUST not
> read part of the second response),
>
> - urllib2 simplify the problem by requiring the server to close
> the connection at each request, hence, no risk of reading a
> second response (this is what _urllib does today for bzr).
There are many more things than that that can go wrong.
With HTTP/1.1 you must support chunked encoding, which gives a clear EOF
indication for each request. You also have to be willing to resubmit the
second request if the server signals EOF or ERROR on the first response
by closing the connection. pipelining of non idempotent requests is
extremly tricky on http. pipelining of range requests is possible but
prone to arbitrary delays when the server/intermediaries decide to do a
full object response. Persistent connections are an optional feature in
HTTP/1.0 and only spottily implemented.
I could go on :(
Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060914/541c226f/attachment.pgp
More information about the bazaar
mailing list