Re: [PATCH v3] http.c: use CURLOPT_RANGE for range requests

2015-11-02 Thread Jeff King
On Mon, Nov 02, 2015 at 05:41:24PM -0500, David Turner wrote: > > Let's switch to using off_t, which should hold any file size > > our system is capable of storing. We need to use ftello() to > > get the off_t. This is in POSIX and hopefully available > > everywhere; if not, we should be able to w

Re: [PATCH v3] http.c: use CURLOPT_RANGE for range requests

2015-11-02 Thread David Turner
On Mon, 2015-11-02 at 17:10 -0500, Jeff King wrote: > On Mon, Nov 02, 2015 at 10:50:10PM +0100, Andreas Schwab wrote: > > > Jeff King writes: > > > > > 4. Fix all of the callers. I suspect this would involve calling > > > fstat(fileno(fh)) to get a real off_t. > > > > You can also use ft

Re: [PATCH v3] http.c: use CURLOPT_RANGE for range requests

2015-11-02 Thread Jeff King
On Mon, Nov 02, 2015 at 10:50:10PM +0100, Andreas Schwab wrote: > Jeff King writes: > > > 4. Fix all of the callers. I suspect this would involve calling > > fstat(fileno(fh)) to get a real off_t. > > You can also use ftello which returns off_t. Thanks, I forgot about that function. Tha

Re: [PATCH v3] http.c: use CURLOPT_RANGE for range requests

2015-11-02 Thread Andreas Schwab
Jeff King writes: > 4. Fix all of the callers. I suspect this would involve calling > fstat(fileno(fh)) to get a real off_t. You can also use ftello which returns off_t. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 827

Re: [PATCH v3] http.c: use CURLOPT_RANGE for range requests

2015-11-02 Thread Jeff King
On Mon, Nov 02, 2015 at 02:36:26PM -0500, David Turner wrote: > A HTTP server is permitted to return a non-range response to a HTTP > range request (and Apache httpd in fact does this in some cases). > While libcurl knows how to correctly handle this (by skipping bytes > before and after the reque

[PATCH v3] http.c: use CURLOPT_RANGE for range requests

2015-11-02 Thread David Turner
A HTTP server is permitted to return a non-range response to a HTTP range request (and Apache httpd in fact does this in some cases). While libcurl knows how to correctly handle this (by skipping bytes before and after the requested range), it only turns on this handling if it is aware that a range