Merge lp://staging/~vila/bzr/2.2-568421-http-error-length into lp://staging/bzr/2.2

Proposed by Vincent Ladeuil
Status: Merged
Approved by: Vincent Ladeuil
Approved revision: no longer in the source branch.
Merged at revision: 5062
Proposed branch: lp://staging/~vila/bzr/2.2-568421-http-error-length
Merge into: lp://staging/bzr/2.2
Diff against target: 58 lines (+38/-0)
2 files modified
NEWS (+3/-0)
bzrlib/tests/http_server.py (+35/-0)
To merge this branch: bzr merge lp://staging/~vila/bzr/2.2-568421-http-error-length
Reviewer Review Type Date Requested Status
John A Meinel Needs Fixing
Review via email: mp+30423@code.staging.launchpad.net

Commit message

Set a Content-Length header on errors for HTTP/1.1

Description of the change

Targeting 2.2 since this concerns maverick and using the right basis this time.

This fixes bug #568421 which was only occurring on gentoo when pycurl was used with gnutls
so far (which made it harder to reproduce, at least for me).

This is due to a long standing bug in the python BaseHTTPServer: some http/1.1 clients requires a length even if the connection is closed. pycurl/gnutls seems to be the only combination choking on this one (but pycurl is also pretty pedantic about connection closes).

It looks like maverick changed the ssl implementation used for pycurl (which made the bug easier to reproduce) so the diagnosis was easier.

There is no easy way to reuse the base send_error so I went for a simplified implementation less likely to fail in the future.

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

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

Vincent Ladeuil wrote:
> Vincent Ladeuil has proposed merging lp:~vila/bzr/2.2-568421-http-error-length into lp:bzr/2.2.
>
> Requested reviews:
> bzr-core (bzr-core)
> Related bugs:
> #568421 test_get_unknown_file fails for pycurl if curl was compiled against gnutls
> https://bugs.launchpad.net/bugs/568421
>
>
> Targeting 2.2 since this concerns maverick and using the right basis this time.
>
> This fixes bug #568421 which was only occurring on gentoo when pycurl was used with gnutls
> so far (which made it harder to reproduce, at least for me).
>
> This is due to a long standing bug in the python BaseHTTPServer: some http/1.1 clients requires a length even if the connection is closed. pycurl/gnutls seems to be the only combination choking on this one (but pycurl is also pretty pedantic about connection closes).
>
> It looks like maverick changed the ssl implementation used for pycurl (which made the bug easier to reproduce) so the diagnosis was easier.
>
> There is no easy way to reuse the base send_error so I went for a simplified implementation less likely to fail in the future.
>

Consider my comments on the bzr.dev proposal to apply here.

 review: needsfixing

(fine to land on 2.2, as long as we don't send content-length
inappropriately, and the class attributes are put somewhere discoverable.)

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

iEYEARECAAYFAkxFwBYACgkQJdeBCYSNAAP+ZwCgr3MtoaWbABdeHHpKqJNi2gbi
8mYAoMOrHt209ZoozBWnjxMjrO3yLXjd
=0X6m
-----END PGP SIGNATURE-----

review: Needs Fixing
Revision history for this message
Vincent Ladeuil (vila) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches