~bzr-pqm/bzr/bzr.dev

Viewing all changes in revision 2520.2.1.

  • Committer: Vincent Ladeuil
  • Date: 2007-06-12 14:48:57 UTC
  • mto: (2574.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 2575.
  • Revision ID: v.ladeuil+lp@free.fr-20070612144857-1swhz5c3qo8n76l8
First step to fix #115209 use _coalesce_offsets like other transports.

* bzrlib/transport/http/__init__.py:
(HttpTransportBase._bytes_to_read_before_seek): Setting it to 512
to minimize additional bytes transferred but still reducing number
of ranges.
(HttpTransportBase.readv): _coalesce_offsets does a better job
than offset_to_ranges/ Reduce code duplication too.
(HttpTransportBase.offsets_to_ranges): Deprecated.
(HttpTransportBase._attempted_range_header): Made private. Adapted
to offsets.
(HttpTransportBase._range_header): Made private. Adapted to
offsets.

* bzrlib/transport/http/_urllib.py:
(HttpTransport_urllib._get): s/ranges/offsets/

* bzrlib/transport/http/_pycurl.py:
(PyCurlTransport._get, PyCurlTransport._get_ranged): s/ranges/offsets/

* bzrlib/tests/__init__.py:
(Transport._coalesce_offsets): Fix minor typo.

* bzrlib/tests/test_http.py:
(TestOffsets): Deleted. We rely on Transport._coalesce_offsets
only now.
(TestRangeHeader.check_header): Convert ranges to offets and use
Transport._coalesce_offsets.
(TestRangeHeader.test_range_header_single): Use tuples not lists !
(TestRanges._file_contents): Convert ranges to offets and use
Transport._coalesce_offsets. And fix indentation too.
(TestRanges._file_tail): Fix indentation.
(TestRanges.test_range_header): Use _file_contents so that we can
still use ranges.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: