~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/protocol.py

  • Committer: John Arbash Meinel
  • Date: 2009-12-10 17:16:19 UTC
  • mfrom: (4884 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4889.
  • Revision ID: john@arbash-meinel.com-20091210171619-ehdcxjbl8afhq9g1
Bring in bzr.dev 4884

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
class SmartServerRequestProtocolOne(SmartProtocolBase):
115
115
    """Server-side encoding and decoding logic for smart version 1."""
116
116
 
117
 
    def __init__(self, backing_transport, write_func, root_client_path='/'):
 
117
    def __init__(self, backing_transport, write_func, root_client_path='/',
 
118
            jail_root=None):
118
119
        self._backing_transport = backing_transport
119
120
        self._root_client_path = root_client_path
 
121
        self._jail_root = jail_root
120
122
        self.unused_data = ''
121
123
        self._finished = False
122
124
        self.in_buffer = ''
144
146
                req_args = _decode_tuple(first_line)
145
147
                self.request = request.SmartServerRequestHandler(
146
148
                    self._backing_transport, commands=request.request_handlers,
147
 
                    root_client_path=self._root_client_path)
148
 
                self.request.dispatch_command(req_args[0], req_args[1:])
 
149
                    root_client_path=self._root_client_path,
 
150
                    jail_root=self._jail_root)
 
151
                self.request.args_received(req_args)
149
152
                if self.request.finished_reading:
150
153
                    # trivial request
151
154
                    self.unused_data = self.in_buffer
858
861
 
859
862
 
860
863
def build_server_protocol_three(backing_transport, write_func,
861
 
                                root_client_path):
 
864
                                root_client_path, jail_root=None):
862
865
    request_handler = request.SmartServerRequestHandler(
863
866
        backing_transport, commands=request.request_handlers,
864
 
        root_client_path=root_client_path)
 
867
        root_client_path=root_client_path, jail_root=jail_root)
865
868
    responder = ProtocolThreeResponder(write_func)
866
869
    message_handler = message.ConventionalRequestHandler(request_handler, responder)
867
870
    return ProtocolThreeDecoder(message_handler)