~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/protocol.py

  • Committer: Martin
  • Date: 2009-11-07 08:02:13 UTC
  • mfrom: (4789 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4809.
  • Revision ID: gzlist@googlemail.com-20091107080213-jad185091b3l69ih
Merge bzr.dev 4789 to resolve conflict from the disabling of plink auto-detection, and relocate NEWS

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)
1209
1212
        except (KeyboardInterrupt, SystemExit):
1210
1213
            raise
1211
1214
        except Exception:
 
1215
            mutter('_iter_with_errors caught error')
 
1216
            log_exception_quietly()
1212
1217
            yield sys.exc_info(), None
1213
1218
            return
1214
1219