/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/protocol.py

  • Committer: Martin Pool
  • Date: 2008-05-27 01:05:57 UTC
  • mfrom: (3452 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3453.
  • Revision ID: mbp@sourcefrog.net-20080527010557-vqz3rab2v816oybw
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1014
1014
    response_marker = request_marker = MESSAGE_VERSION_THREE
1015
1015
 
1016
1016
    def __init__(self, write_func):
1017
 
        self._write_func = write_func
 
1017
        self._buf = ''
 
1018
        self._real_write_func = write_func
 
1019
 
 
1020
    def _write_func(self, bytes):
 
1021
        self._buf += bytes
 
1022
 
 
1023
    def flush(self):
 
1024
        if self._buf:
 
1025
            self._real_write_func(self._buf)
 
1026
            self._buf = ''
1018
1027
 
1019
1028
    def _serialise_offsets(self, offsets):
1020
1029
        """Serialise a readv offset list."""
1046
1055
 
1047
1056
    def _write_end(self):
1048
1057
        self._write_func('e')
 
1058
        self.flush()
1049
1059
 
1050
1060
    def _write_prefixed_body(self, bytes):
1051
1061
        self._write_func('b')
1101
1111
        elif response.body_stream is not None:
1102
1112
            for chunk in response.body_stream:
1103
1113
                self._write_prefixed_body(chunk)
 
1114
                self.flush()
1104
1115
        self._write_end()
1105
1116
        
1106
1117