CURLOPT_NOBODY

4 messages, 2 authors, 2016-06-15 · open the first message on its own page

CURLOPT_NOBODY

From: Thiago Farina <hidden>
Date: 2016-06-15 23:04:35

Hey there,

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.

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

Bye,

-- 
Thiago Farina

Re: CURLOPT_NOBODY

From: Jeff King <hidden>
Date: 2016-06-15 23:04:35

On Wed, Apr 29, 2015 at 11:20:55PM -0300, Thiago Farina wrote:
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

Re: CURLOPT_NOBODY

From: Thiago Farina <hidden>
Date: 2016-06-15 23:04:36

The same logic you apply to CURLOPT_FILE -> CURLOPT_WRITEDATA?

Bye!

-- 
Thiago Farina

Re: CURLOPT_NOBODY

From: Jeff King <hidden>
Date: 2016-06-15 23:04:36

On Thu, Apr 30, 2015 at 04:57:28PM -0300, Thiago Farina wrote:
The same logic you apply to CURLOPT_FILE -> CURLOPT_WRITEDATA?
Maybe. I had to track down the appropriate curl versions for the NOBODY
case manually. If you'd like to do the same for CURLOPT_FILE, be my
guest (and if it has always been that way, I do not mind a cleanup
patch).

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help