Thread (2 messages) flat view 2 messages, 2 authors, 2023-01-15

Re: [PATCH 2/3] http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTION

From: Junio C Hamano <hidden>
Date: 2023-01-15 21:45:45

Possibly related (same subject, not in this thread)

Jeff King [off-list ref] writes:
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help