/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: Andrew Bennetts
  • Date: 2008-03-27 06:10:18 UTC
  • mfrom: (3309 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3320.
  • Revision ID: andrew.bennetts@canonical.com-20080327061018-dxztpxyv6yoeg3am
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
490
490
                mutter('                  (to %s)', self._request._medium._path)
491
491
            mutter('              %d bytes', len(body))
492
492
            self._request_start_time = time.time()
 
493
            if 'hpssdetail' in debug.debug_flags:
 
494
                mutter('hpss body content: %s', body)
493
495
        self._write_args(args)
494
496
        bytes = self._encode_bulk_data(body)
495
497
        self._request.accept_bytes(bytes)
551
553
            return self._body_buffer.read(count)
552
554
        _body_decoder = LengthPrefixedBodyDecoder()
553
555
 
 
556
        # Read no more than 64k at a time so that we don't risk error 10055 (no
 
557
        # buffer space available) on Windows.
 
558
        max_read = 64 * 1024
554
559
        while not _body_decoder.finished_reading:
555
 
            bytes_wanted = _body_decoder.next_read_size()
 
560
            bytes_wanted = min(_body_decoder.next_read_size(), max_read)
556
561
            bytes = self._request.read_bytes(bytes_wanted)
557
562
            _body_decoder.accept_bytes(bytes)
558
563
        self._request.finished_reading()
635
640
    def read_streamed_body(self):
636
641
        """Read bytes from the body, decoding into a byte stream.
637
642
        """
 
643
        # Read no more than 64k at a time so that we don't risk error 10055 (no
 
644
        # buffer space available) on Windows.
 
645
        max_read = 64 * 1024
638
646
        _body_decoder = ChunkedBodyDecoder()
639
647
        while not _body_decoder.finished_reading:
640
 
            bytes_wanted = _body_decoder.next_read_size()
 
648
            bytes_wanted = min(_body_decoder.next_read_size(), max_read)
641
649
            bytes = self._request.read_bytes(bytes_wanted)
642
650
            _body_decoder.accept_bytes(bytes)
643
651
            for body_bytes in iter(_body_decoder.read_next_chunk, None):