[rfc] [patch] pycurl transport
Johan Rydberg
jrydberg at gnu.org
Mon Jan 16 07:45:56 GMT 2006
Martin Pool <mbp at sourcefrog.net> writes:
> Right, so we could turn a
>
> seek()
> read()
>
> into a byte-range request. But perhaps it would be better for Transport
> callers to use something like a pread interface, where they give the
> offset and length all in one go.
In my versionedfile, IIRC, the contract for Transport.get was that it
should return a file-like object which at least has "read" and "seek"
methods.
Maybe we could just extend that contract and force the transport to
return a file-like object that has a "read_block" method, that takes
a list of byte ranges and yields the data (in the same order as the
ranges.) Sounds simple, and should work for most protocols.
~j
More information about the bazaar
mailing list