Merge lp:~vila/bzr/614713-https-pycurl-activity into lp:bzr

Proposed by Vincent Ladeuil
Status: Merged
Approved by: John A Meinel
Approved revision: 6083
Merge reported by: Vincent Ladeuil
Merged at revision: not available
Proposed branch: lp:~vila/bzr/614713-https-pycurl-activity
Merge into: lp:bzr
Diff against target: 45 lines (+8/-5)
2 files modified
bzrlib/transport/http/_pycurl.py (+5/-5)
doc/en/release-notes/bzr-2.5.txt (+3/-0)
To merge this branch: bzr merge lp:~vila/bzr/614713-https-pycurl-activity
Reviewer Review Type Date Requested Status
bzr-core Pending
Review via email: mp+72009@code.launchpad.net

Description of the change

The issue was the activity tests were failing on gentoo for
*some* curl implementations.

We use a debug callback to track the bytes read/written. This
callback is called with a kind and a text.

Some curl implementations calls our callback for
INFOTYPE_SSL_DATA_OUT and INFOTYPE_SSL_DATA_IN (i.e. the
encrypted text), some don't.

The bug is that we should never take these kinds into account
anyway but until I could reproduce the issue I didn't realize
that.

These kinds will still be reported with -Dhttp for debug purposes.

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

Merge:approve
This sort of thing seems reasonable to backport.

John
=:->
On Aug 18, 2011 11:17 AM, "Vincent Ladeuil" <email address hidden> wrote:
> Vincent Ladeuil has proposed merging
lp:~vila/bzr/614713-https-pycurl-activity into lp:bzr.
>
> Requested reviews:
> bzr-core (bzr-core)
> Related bugs:
> Bug #614713 in Bazaar: "selftests fail assertActivitiesMatch for pycurl
compiled against openssl"
> https://bugs.launchpad.net/bzr/+bug/614713
>
> For more details, see:
>
https://code.launchpad.net/~vila/bzr/614713-https-pycurl-activity/+merge/72009
>
> The issue was the activity tests were failing on gentoo for
> *some* curl implementations.
>
> We use a debug callback to track the bytes read/written. This
> callback is called with a kind and a text.
>
> Some curl implementations calls our callback for
> INFOTYPE_SSL_DATA_OUT and INFOTYPE_SSL_DATA_IN (i.e. the
> encrypted text), some don't.
>
> The bug is that we should never take these kinds into account
> anyway but until I could reproduce the issue I didn't realize
> that.
>
> These kinds will still be reported with -Dhttp for debug purposes.
> --
>
https://code.launchpad.net/~vila/bzr/614713-https-pycurl-activity/+merge/72009
> Your team bzr-core is requested to review the proposed merge of
lp:~vila/bzr/614713-https-pycurl-activity into lp:bzr.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/transport/http/_pycurl.py'
2--- bzrlib/transport/http/_pycurl.py 2011-06-14 01:26:41 +0000
3+++ bzrlib/transport/http/_pycurl.py 2011-08-18 09:16:24 +0000
4@@ -327,14 +327,12 @@
5 % (code, msg, plaintext_body))
6
7 def _debug_cb(self, kind, text):
8- if kind in (pycurl.INFOTYPE_HEADER_IN, pycurl.INFOTYPE_DATA_IN,
9- pycurl.INFOTYPE_SSL_DATA_IN):
10+ if kind in (pycurl.INFOTYPE_HEADER_IN, pycurl.INFOTYPE_DATA_IN):
11 self._report_activity(len(text), 'read')
12 if (kind == pycurl.INFOTYPE_HEADER_IN
13 and 'http' in debug.debug_flags):
14 trace.mutter('< %s' % (text.rstrip(),))
15- elif kind in (pycurl.INFOTYPE_HEADER_OUT, pycurl.INFOTYPE_DATA_OUT,
16- pycurl.INFOTYPE_SSL_DATA_OUT):
17+ elif kind in (pycurl.INFOTYPE_HEADER_OUT, pycurl.INFOTYPE_DATA_OUT):
18 self._report_activity(len(text), 'write')
19 if (kind == pycurl.INFOTYPE_HEADER_OUT
20 and 'http' in debug.debug_flags):
21@@ -350,7 +348,9 @@
22 line = '%s: <masked>' % (header,)
23 lines.append(line)
24 trace.mutter('> ' + '\n> '.join(lines))
25- elif kind == pycurl.INFOTYPE_TEXT and 'http' in debug.debug_flags:
26+ elif (kind in (pycurl.INFOTYPE_TEXT, pycurl.INFOTYPE_SSL_DATA_IN,
27+ pycurl.INFOTYPE_SSL_DATA_OUT)
28+ and 'http' in debug.debug_flags):
29 trace.mutter('* %s' % text.rstrip())
30
31 def _set_curl_options(self, curl):
32
33=== modified file 'doc/en/release-notes/bzr-2.5.txt'
34--- doc/en/release-notes/bzr-2.5.txt 2011-08-18 04:23:06 +0000
35+++ doc/en/release-notes/bzr-2.5.txt 2011-08-18 09:16:24 +0000
36@@ -102,6 +102,9 @@
37 * Decode ``BZR_HOME`` with fs encoding on posix platforms to avoid unicode
38 errors. (Vincent Ladeuil, #822571)
39
40+* Fix activity reporting for pycurl when using https with some
41+ implementations of curl. (Vincent Ladeuil, #614713)
42+
43 * Fix i18n use when no environment variables are set. (Jelmer Vernooij, #810701)
44
45 * TreeTransformBase.fixup_new_roots no longer forces trees to have a root, so