~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/http/_pycurl.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-08-21 11:35:35 UTC
  • mfrom: (6089.1.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20110821113535-5pi9vz6tx6wdf62m
(vila) Merge 2.4 into trunk (including fix for #614713, #735417,
 #609187 and #812928) (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
from cStringIO import StringIO
35
35
import httplib
36
36
 
 
37
import bzrlib
37
38
from bzrlib import (
38
39
    debug,
39
40
    errors,
40
41
    trace,
41
42
    )
42
 
import bzrlib
43
43
from bzrlib.transport.http import (
44
44
    ca_bundle,
45
45
    HttpTransportBase,
327
327
                % (code, msg, plaintext_body))
328
328
 
329
329
    def _debug_cb(self, kind, text):
330
 
        if kind in (pycurl.INFOTYPE_HEADER_IN, pycurl.INFOTYPE_DATA_IN,
331
 
                    pycurl.INFOTYPE_SSL_DATA_IN):
 
330
        if kind in (pycurl.INFOTYPE_HEADER_IN, pycurl.INFOTYPE_DATA_IN):
332
331
            self._report_activity(len(text), 'read')
333
332
            if (kind == pycurl.INFOTYPE_HEADER_IN
334
333
                and 'http' in debug.debug_flags):
335
334
                trace.mutter('< %s' % (text.rstrip(),))
336
 
        elif kind in (pycurl.INFOTYPE_HEADER_OUT, pycurl.INFOTYPE_DATA_OUT,
337
 
                      pycurl.INFOTYPE_SSL_DATA_OUT):
 
335
        elif kind in (pycurl.INFOTYPE_HEADER_OUT, pycurl.INFOTYPE_DATA_OUT):
338
336
            self._report_activity(len(text), 'write')
339
337
            if (kind == pycurl.INFOTYPE_HEADER_OUT
340
338
                and 'http' in debug.debug_flags):
352
350
                trace.mutter('> ' + '\n> '.join(lines))
353
351
        elif kind == pycurl.INFOTYPE_TEXT and 'http' in debug.debug_flags:
354
352
            trace.mutter('* %s' % text.rstrip())
 
353
        elif (kind in (pycurl.INFOTYPE_TEXT, pycurl.INFOTYPE_SSL_DATA_IN,
 
354
                       pycurl.INFOTYPE_SSL_DATA_OUT)
 
355
              and 'http' in debug.debug_flags):
 
356
            trace.mutter('* %s' % text)
355
357
 
356
358
    def _set_curl_options(self, curl):
357
359
        """Set options for all requests"""