git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Thiago Farina <tfransosi@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: CURLOPT_NOBODY
Date: Wed, 29 Apr 2015 23:55:12 -0400	[thread overview]
Message-ID: <20150430035512.GC12361@peff.net> (raw)
In-Reply-To: <CACnwZYdCitEJ=pr=1+C_Wz5pKTbSYj4hD7mQHLC3gaDO8CqnrA@mail.gmail.com>

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

  reply	other threads:[~2015-04-30  3:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-30  2:20 CURLOPT_NOBODY Thiago Farina
2015-04-30  3:55 ` Jeff King [this message]
2015-04-30 19:57   ` CURLOPT_NOBODY Thiago Farina
2015-04-30 20:13     ` CURLOPT_NOBODY Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150430035512.GC12361@peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=tfransosi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).