Re: [PATCH 2/3] http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTION
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 15, 2023, 21:45 UTC
- Message-ID
- <xmqqilh7fp4s.fsf@gitster.g>
- In-Reply-To
- <Y8Rd0KXYcHKykvjq@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 13 quoted lines
> The IOCTLFUNCTION option has been deprecated, and generates a compiler
> warning in recent versions of curl. We can switch to using SEEKFUNCTION
> instead. It was added in 2008 via curl 7.18.0; our INSTALL file already
> indicates we require at least curl 7.19.4.
> ...
> + if (offset < 0 || offset >= buffer->buf.len) {
> + error("curl seek would be outside of buffer");
> + return CURL_SEEKFUNC_FAIL;
> }
> +
> + buffer->posn = offset;
> + return CURL_SEEKFUNC_OK;
> }Now we depend on having at least cURL 7.19.5 because CURL_SEEKFUNC_{FAIL,OK} are not available before that version.
cf. https://github.com/curl/curl/blob/master/docs/libcurl/symbols-in-versions#L127
Which is fine, as 7.19.5 is from May 2009 that is old enough. We just need to update the place where you got the 7.19.4 above from.
Thanks.