{"thread":{"id":"18869","subject":"[PATCH] Do curl option disabling before enabling new options","startedAt":"2009-04-14T19:01:01Z","lastAt":"2009-11-23T03:05:02Z","messageCount":3,"participants":["Martin Storsjö","Tay Ray Chuan"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"111305","messageId":"Pine.LNX.4.64.0904142200130.7479@localhost.localdomain","threadId":"18869","inReplyTo":null,"subject":"[PATCH] Do curl option disabling before enabling new options","fromName":"Martin Storsjö","fromEmail":"martin@martin.st","sentAt":"2009-04-14T19:01:01Z","receivedAt":"2009-04-14T19:01:01Z","isPatch":true,"sender":{"key":"martin@martin.st","avatar":"https://avatars.githubusercontent.com/u/69727?v=4"},"body":"This works around a bug in curl versions up to 7.19.4, where\ndisabling the CURLOPT_NOBODY option sets the internal state\nincorrectly considering that CURLOPT_PUT was enabled earlier.\n\nThe bug is discussed at http://curl.haxx.se/bug/view.cgi?id=2727981\nand is corrected in the latest version of curl in CVS.\n\nThis bug usually has no impact on git, but may surface if using\nmulti-pass authentication methods.\n\nSigned-off-by: Martin Storsjo <martin@martin.st>\n---\n http-push.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/http-push.c b/http-push.c\nindex 5138224..3629492 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -599,9 +599,9 @@ static void start_put(struct transfer_request *request)\n #endif\n \tcurl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, fwrite_null);\n \tcurl_easy_setopt(slot->curl, CURLOPT_CUSTOMREQUEST, DAV_PUT);\n+\tcurl_easy_setopt(slot->curl, CURLOPT_NOBODY, 0);\n \tcurl_easy_setopt(slot->curl, CURLOPT_UPLOAD, 1);\n \tcurl_easy_setopt(slot->curl, CURLOPT_PUT, 1);\n-\tcurl_easy_setopt(slot->curl, CURLOPT_NOBODY, 0);\n \tcurl_easy_setopt(slot->curl, CURLOPT_URL, request->url);\n \n \tif (start_active_slot(slot)) {\n-- \n1.6.0.2\n"},{"id":"128145","messageId":"20091123110328.748fcf09.rctay89@gmail.com","threadId":"18869","inReplyTo":"Pine.LNX.4.64.0904142200130.7479@localhost.localdomain","subject":"[PATCH 1/2] Do curl option disabling before enabling new options","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2009-11-23T03:03:28Z","receivedAt":"2009-11-23T03:03:28Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"From: =?ISO-8859-15?Q?Martin_Storsj=F6?= <martin@martin.st>\n\nThis works around a bug in curl versions up to 7.19.4, where\ndisabling the CURLOPT_NOBODY option sets the internal state\nincorrectly considering that CURLOPT_PUT was enabled earlier.\n\nThe bug is discussed at http://curl.haxx.se/bug/view.cgi?id=2727981\nand is corrected in the latest version of curl in CVS.\n\nThis bug usually has no impact on git, but may surface if using\nmulti-pass authentication methods.\n\nSigned-off-by: Martin Storsjo <martin@martin.st>\nSigned-off-by: Tay Ray Chuan <rctay89@gmail.com>\n---\n\n  Squashed in another potential trigger for this bug in remote-curl.c,\n  introduced in 'next'.\n\n http-push.c   |    2 +-\n remote-curl.c |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/http-push.c b/http-push.c\nindex f10803a..295f1fb 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -408,10 +408,10 @@ static void start_put(struct transfer_request *request)\n \tcurl_easy_setopt(slot->curl, CURLOPT_IOCTLDATA, &request->buffer);\n #endif\n \tcurl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, fwrite_null);\n+\tcurl_easy_setopt(slot->curl, CURLOPT_NOBODY, 0);\n \tcurl_easy_setopt(slot->curl, CURLOPT_CUSTOMREQUEST, DAV_PUT);\n \tcurl_easy_setopt(slot->curl, CURLOPT_UPLOAD, 1);\n \tcurl_easy_setopt(slot->curl, CURLOPT_PUT, 1);\n-\tcurl_easy_setopt(slot->curl, CURLOPT_NOBODY, 0);\n \tcurl_easy_setopt(slot->curl, CURLOPT_URL, request->url);\n\n \tif (start_active_slot(slot)) {\ndiff --git a/remote-curl.c b/remote-curl.c\nindex 4f28c22..69eaf58 100644\n--- a/remote-curl.c\n+++ b/remote-curl.c\n@@ -356,8 +356,8 @@ static int post_rpc(struct rpc_state *rpc)\n \tslot = get_active_slot();\n \tslot->results = &results;\n\n-\tcurl_easy_setopt(slot->curl, CURLOPT_POST, 1);\n \tcurl_easy_setopt(slot->curl, CURLOPT_NOBODY, 0);\n+\tcurl_easy_setopt(slot->curl, CURLOPT_POST, 1);\n \tcurl_easy_setopt(slot->curl, CURLOPT_URL, rpc->service_url);\n \tcurl_easy_setopt(slot->curl, CURLOPT_ENCODING, \"\");\n\n--\n1.6.4.4\n"},{"id":"128152","messageId":"be6fef0d0911221905o2e4eae93l1915c16dacfce7a9@mail.gmail.com","threadId":"18869","inReplyTo":"20091123110328.748fcf09.rctay89@gmail.com","subject":"Re: [PATCH 1/2] Do curl option disabling before enabling new options","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2009-11-23T03:05:02Z","receivedAt":"2009-11-23T03:05:02Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Hi,\n\nOn Mon, Nov 23, 2009 at 11:03 AM, Tay Ray Chuan <rctay89@gmail.com> wrote:\n>  Squashed in another potential trigger for this bug in remote-curl.c,\n>  introduced in 'next'.\n\nsorry, this should now read 'master'.\n\n-- \nCheers,\nRay Chuan\n"}]}