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

Re: CURLOPT_NOBODY

From
Jeff King <peff@peff.net>
Date
Apr 30, 2015, 03:55 UTC
Message-ID
<20150430035512.GC12361@peff.net>
In-Reply-To
<CACnwZYdCitEJ=pr=1+C_Wz5pKTbSYj4hD7mQHLC3gaDO8CqnrA@mail.gmail.com>
On Wed, Apr 29, 2015 at 11:20:55PM -0300, Thiago Farina wrote:
Show 8 quoted lines
> Do we need to set CURLOPT_NOBODY to 0 in
> https://code.googlesource.com/git/+/master/http.c#1138? Do we do this
> for the sake of doing, because it doesn't hurt?
> 
> According to the documentation in
> http://curl.haxx.se/libcurl/c/CURLOPT_HTTPGET.html, if we set HTTPGET
> to 1 it will automatically set NOBODY to 0, so the answer for the
> above question would be no.
It may have been necessary at one time...

Running "git blame" on the curl repository's lib/url.c shows that the behavior started in 726b9e2, which is in curl 7.14.1, released in 2005.

Grepping for LIBCURL_VERSION_NUM in git, we definitely support versions older than that. Most of those version checks are quite old, too, and we could probably stop supporting antique versions of curl. But unless there is a compelling benefit (e.g., we get to clean up some old cruft), I'd rather leave things as-is.

Dropping this one line does not seem like a compelling cleanup to me, though it's possible if we said "you must have curl from the last 5 years" we could do other cleanups, and this would come along for the ride.

> Also, according to http://curl.haxx.se/libcurl/c/CURLOPT_NOBODY.html,
> it is 0 by default.

We reuse curl handles, so we reinitialize the request-specific options for each request.

-Peff
Previous: Thiago FarinaNext: Thiago Farina
Message 2 of 4 in “CURLOPT_NOBODY”
  1. Thiago FarinaApr 30, 2015
  2. Jeff KingApr 30, 2015
  3. Thiago FarinaApr 30, 2015
  4. Jeff KingApr 30, 2015

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.