git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Jeff King <peff@peff.net>
Date
Jan 15, 2023, 23:17 UTC
Message-ID
<Y8SJoulYtKnfRgrO@coredump.intra.peff.net>
In-Reply-To
<xmqqilh7fp4s.fsf@gitster.g>
On Sun, Jan 15, 2023 at 01:45:39PM -0800, Junio C Hamano wrote:
Show 20 quoted lines
> Jeff King <peff@peff.net> 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

Ugh. I did not even check that, because why would anyone introduce the return values in a separate version! ;)

> 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.

OK, if we are all right with bumping the version, I can squash that in. The other option is to fall back to the obvious 0/1 for OK/FAIL, which is what curl does. But that feels awfully hacky, and it would only be used if you were at _exactly_ 7.19.4. So I prefer the bump if it's acceptable.

diff --git a/INSTALL b/INSTALL
index 3344788397..d5694f8c47 100644
--- a/INSTALL
+++ b/INSTALL
@@ -139,7 +139,7 @@ Issues of note:
 	  not need that functionality, use NO_CURL to build without
 	  it.
 
-	  Git requires version "7.19.4" or later of "libcurl" to build
+	  Git requires version "7.19.5" or later of "libcurl" to build
 	  without NO_CURL. This version requirement may be bumped in
 	  the future.
 

-Peff
Previous: Junio C HamanoNext: Jeff King
Message 22 of 42 in “ci: do not die on deprecated-declarations warning”
  1. ci: do not die on deprecated-declarations warningJunio C Hamano, Jan 14, 2023
  2. Ramsay JonesJan 14, 2023
  3. Ramsay JonesJan 14, 2023
  4. Junio C HamanoJan 14, 2023
  5. Jeff KingJan 14, 2023
  6. Jeff KingJan 14, 2023
  7. Junio C HamanoJan 14, 2023
  8. Jeff KingJan 14, 2023
  9. Junio C HamanoJan 15, 2023
  10. Jeff KingJan 15, 2023
  11. Junio C HamanoJan 15, 2023
  12. Junio C HamanoJan 14, 2023
  13. Junio C HamanoJan 15, 2023
  14. Jeff KingJan 15, 2023
  15. 1/3 http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUTJeff King, Jan 15, 2023
  16. Ramsay JonesJan 15, 2023
  17. Jeff KingJan 15, 2023
  18. Jeff KingJan 15, 2023
  19. 2/3 http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTIONJeff King, Jan 15, 2023
  20. Ramsay JonesJan 15, 2023
  21. Junio C HamanoJan 15, 2023
  22. Jeff KingJan 15, 2023
  23. 3/3 http: support CURLOPT_PROTOCOLS_STRJeff King, Jan 15, 2023
  24. Ramsay JonesJan 15, 2023
  25. Jeff KingJan 15, 2023
  26. Ævar Arnfjörð BjarmasonJan 16, 2023
  27. Junio C HamanoJan 16, 2023
  28. Junio C HamanoJan 16, 2023
  29. Jeff KingJan 16, 2023
  30. Jeff KingJan 16, 2023
  31. avoiding deprecated curl optionsJeff King, Jan 17, 2023
  32. 1/3 http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUTJeff King, Jan 17, 2023
  33. 2/3 http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTIONJeff King, Jan 17, 2023
  34. 3/3 http: support CURLOPT_PROTOCOLS_STRJeff King, Jan 17, 2023
  35. Ramsay JonesJan 18, 2023
  36. Jeff KingJan 14, 2023
  37. Ramsay JonesJan 16, 2023
  38. Jeff KingJan 16, 2023
  39. ci: do not die on deprecated-declarations warningJunio C Hamano, Jan 14, 2023
  40. Jeff KingJan 14, 2023
  41. 1/3 http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUTJeff King, Jan 17, 2023
  42. Jeff KingJan 17, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.