/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/smart/client.py

  • Committer: Andrew Bennetts
  • Date: 2008-02-25 02:24:19 UTC
  • mto: (3245.4.1 Version 3 implementation.)
  • mto: This revision was merged to the branch mainline in revision 3428.
  • Revision ID: andrew.bennetts@canonical.com-20080225022419-b8en5fsed6vez0gv
call_with_body_bytes now works with v3 (e.g. test_copy_content_remote_to_local passes).  Lots of debugging cruft, though.

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
                raise TypeError('args must be byte strings, not %r' % (args,))
71
71
        if type(body) is not str:
72
72
            raise TypeError('body must be byte string, not %r' % (body,))
73
 
        request = self.get_smart_medium().get_request()
74
 
        smart_protocol = protocol.SmartClientRequestProtocolOne(request)
75
 
        smart_protocol.call_with_body_bytes((method, ) + args, body)
76
 
        return smart_protocol.read_response_tuple()
 
73
        # Get a medium
 
74
        medium_request = self.get_smart_medium().get_request()
 
75
 
 
76
        # Send a request over the medium
 
77
        request_encoder = protocol.ProtocolThreeRequester(medium_request)
 
78
        request_encoder.call_with_body_bytes((method, ) + args, body)
 
79
        
 
80
        # Handle the response
 
81
        response_handler = message.ConventionalResponseHandler()
 
82
        response_proto = protocol._ProtocolThreeBase(response_handler)
 
83
        response_handler.setProtoAndMedium(response_proto, medium_request)
 
84
        response_tuple = response_handler.read_response_tuple()
 
85
        return response_tuple
 
86
#        request = self.get_smart_medium().get_request()
 
87
#        smart_protocol = protocol.SmartClientRequestProtocolOne(request)
 
88
#        smart_protocol.call_with_body_bytes((method, ) + args, body)
 
89
#        return smart_protocol.read_response_tuple()
77
90
 
78
91
    def call_with_body_bytes_expecting_body(self, method, args, body):
79
92
        """Call a method on the remote server with body bytes."""