[MERGE] http+pycurl supports redirects

John Arbash Meinel john at arbash-meinel.com
Tue Jul 18 21:59:47 BST 2006


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

The reason we failed to support pycurl redirects is because pycurl would
put both the original redirect headers, and the final content request
headers into the 'header file'.

The attached patch just updates the header parser, so that it checks to
see if there is anything after the initial headers. If there is, it
extracts that as the real header and returns it.

The attached patch contains the actual response headers from trying to
download from bazaar-ng.org. And tests that we parse it correctly.

I also verified that we can do a plain download from bazaar-ng.org.

I think I'd like to file a bug that we don't *know* when we are getting
a redirect, and alert the user that they really should update their url.
(downloading over a redirect will cause an extra round-trip for each
request).

Either that, or we could allow some way for transports to change their
base URL on a redirect. But it kind of complicates things, because we
don't know about the redirect until the first request.

Also, when it was proposed a while ago, it was discussed that someone
might just redirect the branch location, but not the repository
location. Anyway, I think we probably want a warning if we get a
redirect. But right now we don't have a good way to extract that
information from pycurl or urllib, because both of them auto-follow the
redirect for us.

So with this patch, I think I've satisfied all of the regressions about
the new http support. I'll wait for reviews, but rather than waiting
another 2 weeks, I'll merge it tomorrow if nobody complains.

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

iD8DBQFEvUvDJdeBCYSNAAMRAiS8AKCzpRC/0f9FbCPBECGyee+9+rk88ACfSaV6
o9qL3MRIe3oVtqBTnwmsNQw=
=JilC
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: http-redirect.diff
Type: text/x-patch
Size: 4860 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060718/01315df0/attachment.bin 


More information about the bazaar mailing list