[MERGE] Default to urllib for http connections

Vincent Ladeuil v.ladeuil+lp at free.fr
Tue Dec 9 07:49:20 GMT 2008


>>>>> "jam" == John Arbash Meinel <john at arbash-meinel.com> writes:

    jam> This patch changes the default http provider from http+pycurl to
    jam> http+urllib.

    jam> The motivation is that in general, urllib provides better results. It
    jam> can be interrupted, it removes a dependency on a 3rd-party library which
    jam> seems to change in random and often incompatible ways, etc.

    jam> The main reason we have kept pycurl around is because urllib doesn't
    jam> verify the ssl certificate chain for https connections.

Work in progress but requiring python-2.6 so far (or adding a
dependency on the ssl module which is available for python 2.5
and 2.4).

    jam> However, that doesn't bring any benefit to http
    jam> connections.

That sounds reasonable.

BB:approve

Keep in mind though, that it has subtle consequences in case of
redirections, the http client implementation is changed when
redirecting from http to https and vice-versa which is not the
case without your patch.

I use a simple plugin:

,----
| """Make urllib the default http implementation."""
| 
| from bzrlib import transport
| 
| 
| transport.register_lazy_transport('http://', 'bzrlib.transport.http._urllib',
|                                   'HttpTransport_urllib')
| transport.register_lazy_transport('https://', 'bzrlib.transport.http._urllib',
|                                   'HttpTransport_urllib')
| 
`----

that defaults to urllib for both protocols, has the same
property, but still allows me to test pycurl support.

If/when

http://bundlebuggy.aaronbentley.com/project/bzr/request/%3Cm21vwnx347.fsf%40free.fr%3E

is merged, this will change and *preserve* the http client
implementation used for the initial location.

               Vincent




More information about the bazaar mailing list