bzr log http+urllib does not work, http+pycurl is too slow

John Arbash Meinel john at arbash-meinel.com
Wed Dec 12 18:28:22 GMT 2007


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

Vincent Ladeuil wrote:

...

>     john> Can't you just see that you got a 200 response back for
>     john> a range request, rather than a 206?
> 
> Hmmm, not the right layer for that.
> 
>     john> Also, I would recommend including at least the
>     john> http://host portion of the URL, 
> 
> I'd like to too, but all I have here is the body response, so no
> url.. a status, an http version (but I'm not sure it's 100% right
> if proxies are involved), the headers and the bytes (well, the
> remaining ones).
> 
>     john> and only issuing 1 warning per server. (Rather than
>     john> possibly on every request.)


What is wrong with a patch like this:

=== modified file 'bzrlib/transport/http/_urllib.py'
- --- bzrlib/transport/http/_urllib.py    2007-12-03 08:33:06 +0000
+++ bzrlib/transport/http/_urllib.py    2007-12-12 18:26:34 +0000
@@ -143,6 +143,10 @@
             raise errors.InvalidHttpRange(abspath, range_header,
                                           'Server return code %d' % code)

+        if code == 200 and offsets:
+            trace.warning('Got a 200 response when asking for multiple ranges'
+                          ' does your server at %s support range requests?',
+                          self.base)
         data = handle_response(abspath, code, response.info(), response)
         return code, data

I completely agree that there are 2 pieces. One is that we shouldn't clear the
buffer with 1 giant read, but it should be broken down. And your patch for that
is fine.

But why not warn at the upper layer, since we know in advance that we are
getting the wrong return value.

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

iD8DBQFHYChGJdeBCYSNAAMRAn4ZAJ9giH+n8vS6G2L8MmEIBKcM02fCEwCfSuGV
i91OJa2F/ZPQBTECQk+okgE=
=jO5b
-----END PGP SIGNATURE-----



More information about the bazaar mailing list