git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Martin Storsjö" <martin@martin.st>
To: git@vger.kernel.org
Subject: [PATCH] Do curl option disabling before enabling new options
Date: Tue, 14 Apr 2009 22:01:01 +0300 (EEST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0904142200130.7479@localhost.localdomain> (raw)

This works around a bug in curl versions up to 7.19.4, where
disabling the CURLOPT_NOBODY option sets the internal state
incorrectly considering that CURLOPT_PUT was enabled earlier.

The bug is discussed at http://curl.haxx.se/bug/view.cgi?id=2727981
and is corrected in the latest version of curl in CVS.

This bug usually has no impact on git, but may surface if using
multi-pass authentication methods.

Signed-off-by: Martin Storsjo <martin@martin.st>
---
 http-push.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/http-push.c b/http-push.c
index 5138224..3629492 100644
--- a/http-push.c
+++ b/http-push.c
@@ -599,9 +599,9 @@ static void start_put(struct transfer_request *request)
 #endif
 	curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, fwrite_null);
 	curl_easy_setopt(slot->curl, CURLOPT_CUSTOMREQUEST, DAV_PUT);
+	curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 0);
 	curl_easy_setopt(slot->curl, CURLOPT_UPLOAD, 1);
 	curl_easy_setopt(slot->curl, CURLOPT_PUT, 1);
-	curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 0);
 	curl_easy_setopt(slot->curl, CURLOPT_URL, request->url);
 
 	if (start_active_slot(slot)) {
-- 
1.6.0.2

         reply	other threads:[~2009-04-14 19:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-23  3:03 [PATCH 0/2] http fixes Tay Ray Chuan
2009-11-24  1:48 ` [PATCH v2 " Tay Ray Chuan
2009-04-14 19:01   ` Martin Storsjö [this message]
2009-11-23  3:03     ` [PATCH 1/2] Do curl option disabling before enabling new options Tay Ray Chuan
2009-11-23  3:05       ` Tay Ray Chuan
2009-11-24  1:50     ` [PATCH v2 " Tay Ray Chuan
2009-11-24  1:55   ` [PATCH v2 2/2] remote-curl.c: fix rpc_out() Tay Ray Chuan
2009-11-24  2:31     ` [PATCH v3] " Tay Ray Chuan
2009-11-24 22:43       ` Shawn O. Pearce

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=Pine.LNX.4.64.0904142200130.7479@localhost.localdomain \
    --to=martin@martin.st \
    --cc=git@vger.kernel.org \
    /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).