~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/client.py

  • Committer: Andrew Bennetts
  • Date: 2008-05-08 06:29:07 UTC
  • mto: This revision was merged to the branch mainline in revision 3428.
  • Revision ID: andrew.bennetts@canonical.com-20080508062907-gk5ycaa6wm6qrggq
Don't automatically send 'hello' requests from RemoteBzrDirFormat.probe_transport unless we have to (i.e. the transport is HTTP).

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
        """
32
32
        self._medium = medium
33
33
        self._base = base
34
 
        self._protocol_version = None
35
34
        if headers is None:
36
35
            self._headers = {'Software version': bzrlib.__version__}
37
36
        else:
56
55
 
57
56
    def _call_and_read_response(self, method, args, body=None, readv_body=None,
58
57
            expect_response_body=True):
59
 
        if self._protocol_version is not None:
 
58
        if self._medium._protocol_version is not None:
60
59
            response_handler = self._send_request(
61
 
                self._protocol_version, method, args, body=body,
 
60
                self._medium._protocol_version, method, args, body=body,
62
61
                readv_body=readv_body)
63
62
            return (response_handler.read_response_tuple(
64
63
                        expect_body=expect_response_body),
77
76
                    self._medium.disconnect()
78
77
                    continue
79
78
                else:
80
 
                    self._protocol_version = protocol_version
 
79
                    self._medium._protocol_version = protocol_version
81
80
                    return response_tuple, response_handler
82
81
            raise errors.SmartProtocolError(
83
82
                'Server is not a Bazaar server: ' + str(err))