~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/protocol.py

  • Committer: Andrew Bennetts
  • Date: 2007-08-17 08:31:52 UTC
  • mto: This revision was merged to the branch mainline in revision 3320.
  • Revision ID: andrew.bennetts@canonical.com-20070817083152-rmhqerwquini7tiz
Add translate_client_path method to SmartServerRequest.

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
class SmartServerRequestProtocolOne(SmartProtocolBase):
73
73
    """Server-side encoding and decoding logic for smart version 1."""
74
74
    
75
 
    def __init__(self, backing_transport, write_func):
 
75
    def __init__(self, backing_transport, write_func, root_client_path='/'):
76
76
        self._backing_transport = backing_transport
 
77
        self._root_client_path = root_client_path
77
78
        self.excess_buffer = ''
78
79
        self._finished = False
79
80
        self.in_buffer = ''
99
100
                first_line += '\n'
100
101
                req_args = _decode_tuple(first_line)
101
102
                self.request = request.SmartServerRequestHandler(
102
 
                    self._backing_transport, commands=request.request_handlers)
 
103
                    self._backing_transport, commands=request.request_handlers,
 
104
                    root_client_path=self._root_client_path)
103
105
                self.request.dispatch_command(req_args[0], req_args[1:])
104
106
                if self.request.finished_reading:
105
107
                    # trivial request
305
307
    def call(self, *args):
306
308
        if 'hpss' in debug.debug_flags:
307
309
            mutter('hpss call:   %s', repr(args)[1:-1])
 
310
            mutter('             (to: %r)' % (self._request._medium))
308
311
            self._request_start_time = time.time()
309
312
        self._write_args(args)
310
313
        self._request.finished_writing()