/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2007-11-30 09:51:22 UTC
  • mto: (3059.2.1 173010)
  • mto: This revision was merged to the branch mainline in revision 3060.
  • Revision ID: v.ladeuil+lp@free.fr-20071130095122-6xz845lluzjp7tvs
Add -Dhttp support.

* bzrlib/transport/http/_urllib2_wrappers.py:
(HTTPConnection.__init__): Report the host we are about to connect
to if -Dhttp is used.
(AbstractHTTPHandler.do_open): Report requests and
responses (including headers) if -Dhttp is used.

* bzrlib/transport/http/_urllib.py: Fix some imports.
(HttpTransport_urllib._perform): Delete one mutter call since
-Dhttp provides better information.

* bzrlib/transport/http/_pycurl.py:
Fix some imports.
(PyCurlTransport._set_curl_options): Activate verbose output if
-Dhttp is used. Unfortunately this goes straight to stderr instead
of .bzr.log (libcurl provides an option but pycurl does not
implement it), but since we are debugging, I think it's
acceptable.

* bzrlib/transport/http/__init__.py:
(HttpTransportBase._coalesce_readv): Add a comment about the
servers that return the whole file ignoring the Ranges header.

* bzrlib/help_topics.py:
(_global_options): Add http.

* bzrlib/debug.py: 
Add 'http'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
from bzrlib import (
22
22
    errors,
 
23
    trace,
23
24
    urlutils,
24
25
    )
25
 
from bzrlib.trace import mutter
26
 
from bzrlib.transport.http import HttpTransportBase
 
26
from bzrlib.transport import http
27
27
# TODO: handle_response should be integrated into the _urllib2_wrappers
28
28
from bzrlib.transport.http.response import handle_response
29
29
from bzrlib.transport.http._urllib2_wrappers import (
32
32
    )
33
33
 
34
34
 
35
 
class HttpTransport_urllib(HttpTransportBase):
 
35
class HttpTransport_urllib(http.HttpTransportBase):
36
36
    """Python urllib transport for http and https."""
37
37
 
38
38
    # In order to debug we have to issue our traces in sync with
85
85
        request.auth = auth
86
86
        request.proxy_auth = proxy_auth
87
87
 
88
 
        mutter('%s: [%s]' % (request.method, request.get_full_url()))
89
88
        if self._debuglevel > 0:
90
89
            print 'perform: %s base: %s, url: %s' % (request.method, self.base,
91
90
                                                     request.get_full_url())
108
107
                                           qual_proto=self._scheme)
109
108
 
110
109
        if request.redirected_to is not None:
111
 
            mutter('redirected from: %s to: %s' % (request.get_full_url(),
112
 
                                                   request.redirected_to))
 
110
            trace.mutter('redirected from: %s to: %s' % (request.get_full_url(),
 
111
                                                         request.redirected_to))
113
112
 
114
113
        return response
115
114