~bzr-pqm/bzr/bzr.dev

Read http responses on demand without buffering the whole body
response.

* bzrlib/transport/http/response.py:
New implementation of handle_response with only one RangeFile
class covering all the needs. The main purpose is to read the data
on demand instead of buffering everything at the beginning. The
main target is readv but get needs are addressed as well.
(RangeFile): Respect socket use by handling ranges on the fly and
never seeking backwards.
(HttpRangeResponse, HttpMultipartRangeResponse): Deleted.
(handle_response): The 'headers' parameter is now an HTTPMessage
containing the response headers. Stop handling 4xx error codes,
the clients do that themselves.

* bzrlib/transport/http/_urllib2_wrappers.py:
(AbstractHTTPConnection.cleanup_pipe): Renamed from 'fake_close'
the new name is more appropriate and less scary (the content is the
same though).
(HTTPDefaultErrorHandler.http_error_default): Stop handling 416
here to get a finer control in the layer above.

* bzrlib/transport/http/_urllib.py:
(HttpTransport_urllib._perform): Cleanup the httplib pipe before
each request so that clients can leave it dirty without worrying.
(HttpTransport_urllib._get): Add 416 as an expected error so that
we handle it (_urllib2_wrappers was handling it before).
(HttpTransport_urllib._get): Handle 400 and 416 errors here. Don't
bother cleaning the pipe anymore.
(HttpTransport_urllib._post, HttpTransport_urllib._head): Don't
bother cleaning the pipe anymore.

* bzrlib/transport/http/_pycurl.py:
(PyCurlTransport._get_ranged): Handle 400 and 416 errors
here. Also use HTTPMessage to replace the _extract_headers use.
(PyCurlTransport._parse_headers): New method. Create an
HTTPMessage from the raw headers provided by pycurl.

* bzrlib/transport/http/__init__.py:
(_extract_headers): Deleted. HTTPMessage is a better alternative.
(HttpTransportBase.get): Wrap the result in a StringIO since same
callers want an iterable, stop gap to make the tests pass, MUST be
fixed.
(HttpTransportBase._readv): Also catch InvalidHttpRange.
(HttpTransportBase._coalesce_readv): Indicates that only
InvalidHttpRange (not InvalidRange) can be raised from there.

* bzrlib/transport/__init__.py:
(_CoalescedOffset.__repr__): Provided by jam and lost in previous
patches.

* bzrlib/tests/test_transport_implementations.py:
(TransportTests.test_get): Switch from zip() to itertools.imap or
the transport requests are all issued before reading the files.
This works for sftp since several file-handles can be created on a
single ssh connection, for ftp since all get() are StringIO
buffered (bang head against desktop) and used to work with http
before the http response rewriting.

* bzrlib/tests/test_http_response.py: Test the new RangeFile
implementation, get rid of now useless tests. All deleted tests
have been reviewed to avoid test coverage regression.

* bzrlib/tests/HttpServer.py:
(TestingHTTPRequestHandler.get_multiple_ranges): Only one boundary
line per part should be written.

* bzrlib/errors.py:
(InvalidRange.__init__): The msg was duplicated.
(InvalidHttpRange.__init__): Add an optional 'msg' attribute.

Filename Latest Rev Last Changed Committer Comment Size
..
doc_generate 1534.7.158 19 years ago Aaron Bentley Merged John Meinel's integration Diff
win32 1821.1.1 18 years ago Alexander Belchenko win32 installer for bzr.dev.0.9 Diff
__init__.py 1534.7.158 19 years ago Aaron Bentley Merged John Meinel's integration Empty Diff Download File
File biobench.py 1185.44.26 19 years ago Martin Pool Make biobench directly executable 2.3 KB Diff Download File
bzr_epydoc 2399.1.15 17 years ago John Arbash Meinel [merge] api-doc-builder and remove the pydoctor bu 264 bytes Diff Download File
bzr_epydoc_uid.py 2399.1.15 17 years ago John Arbash Meinel [merge] api-doc-builder and remove the pydoctor bu 1.3 KB Diff Download File
capture_tree.py 2624.1.1 17 years ago Adeodato Simó Loose python2.4-specific shebangs; use generic pyt 1 KB Diff Download File
convertfile.py 1887.1.1 18 years ago Adeodato Simó Do not separate paragraphs in the copyright statem 2.1 KB Diff Download File
convertinv.py 1887.1.1 18 years ago Adeodato Simó Do not separate paragraphs in the copyright statem 2 KB Diff Download File
history2revfiles.py 1887.1.1 18 years ago Adeodato Simó Do not separate paragraphs in the copyright statem 2.8 KB Diff Download File
http_client.py 1963.2.6 18 years ago Robey Pointer pychecker is on crack; go back to using 'is None'. 15 KB Diff Download File
riodemo.py 1185.47.1 19 years ago Martin Pool [broken] start converting basic_io to more rfc822- 1.9 KB Diff Download File
File rst2html.py 2677.1.1 17 years ago Alexander Belchenko rst2html: workaround for IE bug with id="tags" 1.2 KB Diff Download File
File rst2prettyhtml.py 2691.1.17 17 years ago Ian Clatworthy Fix pretty doc generation so works for all html do 1.8 KB Diff Download File
File trace-revisions 2624.1.1 17 years ago Adeodato Simó Loose python2.4-specific shebangs; use generic pyt 317 bytes Diff Download File
weavebench.py 1887.1.1 18 years ago Adeodato Simó Do not separate paragraphs in the copyright statem 2.6 KB Diff Download File
weavemerge.sh 1185.1.29 19 years ago Robert Collins merge merge tweaks from aaron, which includes late 584 bytes Diff Download File