[MERGE][bug #175886][RFC][1.0] Read superfluous bytes sent by dumb http servers by chunks.

John Arbash Meinel john at arbash-meinel.com
Thu Dec 13 16:07:21 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Vincent Ladeuil wrote:

...

>     bialix> bb:comment
> 
>     bialix> 1) for `bzr log http://` the warning was printed after first portion of
>     bialix> data was emitted. It's strange. Looks like the bug for me. If my dumb
>     bialix> server always sent full text why you catch this fact only on second readv?
> 
> That's the intended behavior, the problem is detected when we try
> to issue the next request (the http transport is not notified
> when the caller finished processing the readv results).
> 
> John's proposal would have provided the behavior you asked for,
> but emitting the warning only once and only above a byte threshold
> would have been more complicated.

Well, emitting it only once is just having some state on the HTTPTransport. But
I suppose you would end up wanting to share that state between clones, etc.

I'm not sure about issuing it only above a byte threshold. I guess that is
reasonable, since then you only warn if it seems to be a performance issue.

I suppose doing it there means you cover both pycurl and urllib.

However, will it warn in the case that I ask for the last 10 bytes of a pack
file, and I get back all 10MB?

> 
> I'd prefer to wait for a bit more feedback from real cases to
> decide if this complexity is worth it
> 
>     bialix> 2) Your warning message should be marked with some
>     bialix> distinct prefix, IMO.  I suggest to use something
>     bialix> like: "bzr: WARNING: Got a 200 response..."
> 
> Why make a particular case ? Plus, prefixing by 'bzr:' seems a
> bit strange, we *are* bzr ;)
> 
>         Vincent
> 
> 

Well, we do:

bzr command
^C
bzr: interrupted

I think it is fairly common for programs which write out information messages
to inform the user who is giving those messages. I think the "bzr: interrupted"
is mostly because it is returning control to the shell, so that last line could
be confusing.

Personally, I'm fine with just WARNING:.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHYVi5JdeBCYSNAAMRAnRuAKCEKJJn057lffVCeT5RwqHVvN3XdgCdHq9R
fgxv7XEKIoN+LWk0tRtvl7U=
=UATo
-----END PGP SIGNATURE-----



More information about the bazaar mailing list