~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/protocol.py

  • Committer: Martin Pool
  • Date: 2008-06-25 10:06:48 UTC
  • mfrom: (3509 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3510.
  • Revision ID: mbp@sourcefrog.net-20080625100648-ac20jxcm3ojucuby
merge trunk; remove RemoteToOtherFetcher

Show diffs side-by-side

added added

removed removed

Lines of Context:
704
704
        while not _body_decoder.finished_reading:
705
705
            bytes_wanted = min(_body_decoder.next_read_size(), max_read)
706
706
            bytes = self._request.read_bytes(bytes_wanted)
 
707
            if bytes == '':
 
708
                # end of file encountered reading from server
 
709
                raise errors.ConnectionReset(
 
710
                    "Connection lost while reading response body.")
707
711
            _body_decoder.accept_bytes(bytes)
708
712
        self._request.finished_reading()
709
713
        self._body_buffer = StringIO(_body_decoder.read_pending_data())
805
809
        while not _body_decoder.finished_reading:
806
810
            bytes_wanted = min(_body_decoder.next_read_size(), max_read)
807
811
            bytes = self._request.read_bytes(bytes_wanted)
 
812
            if bytes == '':
 
813
                # end of file encountered reading from server
 
814
                raise errors.ConnectionReset(
 
815
                    "Connection lost while reading streamed body.")
808
816
            _body_decoder.accept_bytes(bytes)
809
817
            for body_bytes in iter(_body_decoder.read_next_chunk, None):
810
818
                if 'hpss' in debug.debug_flags and type(body_bytes) is str: