~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/protocol.py

Rename _ProtocolThreeBase to ProtocolThreeDecoder, remove SmartServerRequestProtocolThree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
684
684
        backing_transport, commands=request.request_handlers)
685
685
    responder = ProtocolThreeResponder(write_func)
686
686
    message_handler = message.ConventionalRequestHandler(request_handler, responder)
687
 
    return _ProtocolThreeBase(message_handler)
688
 
 
689
 
 
690
 
class _ProtocolThreeBase(_StatefulDecoder):
 
687
    return ProtocolThreeDecoder(message_handler)
 
688
 
 
689
 
 
690
class ProtocolThreeDecoder(_StatefulDecoder):
691
691
 
692
692
    response_marker = RESPONSE_VERSION_THREE
693
693
    request_marker = REQUEST_VERSION_THREE
846
846
                return 1 # XXX !!!
847
847
 
848
848
 
849
 
class SmartServerRequestProtocolThree(_ProtocolThreeBase):
850
 
 
851
 
    def _args_received(self, args):
852
 
        if len(args) < 1:
853
 
            raise errors.SmartProtocolError('Empty argument sequence')
854
 
        self.state_accept = self._state_accept_expecting_body_kind
855
 
        self.request_handler.args_received(args)
856
 
 
857
 
 
858
 
class SmartClientRequestProtocolThree(_ProtocolThreeBase, SmartClientRequestProtocolTwo):
 
849
class SmartClientRequestProtocolThree(ProtocolThreeDecoder, SmartClientRequestProtocolTwo):
859
850
 
860
851
    response_marker = RESPONSE_VERSION_THREE
861
852
    request_marker = REQUEST_VERSION_THREE
862
853
 
863
854
    def __init__(self, client_medium_request):
864
855
        from bzrlib.smart.message import MessageHandler
865
 
        _ProtocolThreeBase.__init__(self, MessageHandler())
 
856
        ProtocolThreeDecoder.__init__(self, MessageHandler())
866
857
        SmartClientRequestProtocolTwo.__init__(self, client_medium_request)
867
858
        # Initial state
868
859
        self._in_buffer = ''