All of lore.kernel.org
 help / color / mirror / Atom feed
* CURLOPT_NOBODY
@ 2015-04-30  2:20 Thiago Farina
  2015-04-30  3:55 ` CURLOPT_NOBODY Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: Thiago Farina @ 2015-04-30  2:20 UTC (permalink / raw)
  To: Git Mailing List

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: CURLOPT_NOBODY
  2015-04-30  2:20 CURLOPT_NOBODY Thiago Farina
@ 2015-04-30  3:55 ` Jeff King
  2015-04-30 19:57   ` CURLOPT_NOBODY Thiago Farina
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff King @ 2015-04-30  3:55 UTC (permalink / raw)
  To: Thiago Farina; +Cc: Git Mailing List

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: CURLOPT_NOBODY
  2015-04-30  3:55 ` CURLOPT_NOBODY Jeff King
@ 2015-04-30 19:57   ` Thiago Farina
  2015-04-30 20:13     ` CURLOPT_NOBODY Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: Thiago Farina @ 2015-04-30 19:57 UTC (permalink / raw)
  To: Jeff King; +Cc: Git Mailing List

The same logic you apply to CURLOPT_FILE -> CURLOPT_WRITEDATA?

Bye!

-- 
Thiago Farina

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: CURLOPT_NOBODY
  2015-04-30 19:57   ` CURLOPT_NOBODY Thiago Farina
@ 2015-04-30 20:13     ` Jeff King
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff King @ 2015-04-30 20:13 UTC (permalink / raw)
  To: Thiago Farina; +Cc: Git Mailing List

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-04-30 20:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-30  2:20 CURLOPT_NOBODY Thiago Farina
2015-04-30  3:55 ` CURLOPT_NOBODY Jeff King
2015-04-30 19:57   ` CURLOPT_NOBODY Thiago Farina
2015-04-30 20:13     ` CURLOPT_NOBODY Jeff King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.