[MERGE] Add traffic support to HTTP
John Arbash Meinel
john at arbash-meinel.com
Fri Jan 23 21:30:23 GMT 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Attached is a patch to our HTTP implementations so that
HTTPTransport.get() and HTTPTransport.readv() use the new
_report_activity functionality to let the user know that data is coming
across on the wire.
I decided to do it in osutils.pumpfile() with the idea that if a
specific range ended up being >32kB you get more feedback this way.
With this in place, it does start giving some update ticks while doing
"bzr branch http://bazaar-vcs.org/bzr/bzr.dev" which is nice (especially
since there is a pretty long startup time as it searches the ancestry
graph.)
The only other bit that we *might* want to do, is to consider the HTTP
headers, etc. I figured tracking the bulk data was good enough, though.
As near as I can tell, both pycurl and urllib go through
bzrlib.transport.http.response.handle_response() and that always goes
through osutils.pumpfile() to handle all of the .read() requests. So by
instrumenting it at this level, we should avoid any double-handling or
missing data being sent.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkl6Nu8ACgkQJdeBCYSNAAP3KACdHTXkAotOhOj+LiE1mos0FjnU
MrcAnjtHj50X7d7DiL1A3I+M+MIiQ0dN
=xTfC
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 1.12-network-io.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20090123/f186edd1/attachment.diff
More information about the bazaar
mailing list