{"thread":{"id":"21720","subject":"[PATCH 0/2] http fixes","startedAt":"2009-11-23T03:03:47Z","lastAt":"2009-11-24T22:43:31Z","messageCount":6,"participants":["Tay Ray Chuan","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"128147","messageId":"20091123110347.d47728f8.rctay89@gmail.com","threadId":"21720","inReplyTo":null,"subject":"[PATCH 0/2] http fixes","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2009-11-23T03:03:47Z","receivedAt":"2009-11-23T03:03:47Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Patch 1 (\"Do curl option disabling before enabling new options\"):\n  This is a workaround for a fairly recent curl issue that affected\n  versions up to 7.19.4.\n\nPatch 2 (\"remote-curl.c: fix rpc_out()\"):\n  Fixes issues that affect chunked encoding.\n\n http-push.c   |    2 +-\n remote-curl.c |   19 ++++++++++++-------\n 2 files changed, 13 insertions(+), 8 deletions(-)\n\n--\nCheers,\nRay Chuan\n"},{"id":"128222","messageId":"20091124094810.797341d4.rctay89@gmail.com","threadId":"21720","inReplyTo":"20091123110347.d47728f8.rctay89@gmail.com","subject":"[PATCH v2 0/2] http fixes","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2009-11-24T01:48:10Z","receivedAt":"2009-11-24T01:48:10Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"This series is a re-roll and is based on 'master'.\n\nPatch 1 (\"Do curl option disabling before enabling new options\"):\n No changes from the previous version.\n\nPatch 2 (\"remote-curl.c: fix rpc_out()\"):\n Focus solely on the extraneous semicolon.\n\n http-push.c   |    2 +-\n remote-curl.c |    4 ++--\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\n--\nCheers,\nRay Chuan\n"},{"id":"128223","messageId":"20091124095021.93942a56.rctay89@gmail.com","threadId":"21720","inReplyTo":"20091124094810.797341d4.rctay89@gmail.com","subject":"[PATCH v2 1/2] Do curl option disabling before enabling new options","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2009-11-24T01:50:21Z","receivedAt":"2009-11-24T01:50:21Z","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  No changes from the previous version.\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 0e040f8..432b20f 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":"128224","messageId":"20091124095508.d6312ab0.rctay89@gmail.com","threadId":"21720","inReplyTo":"20091124095021.93942a56.rctay89@gmail.com","subject":"[PATCH v2 2/2] remote-curl.c: fix rpc_out()","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2009-11-24T01:55:08Z","receivedAt":"2009-11-24T01:55:08Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Remove the extraneous semicolon (';') at the end of the if statement,\nthat prevented code in its block from executing.\n\nThis fixes pushing to a smart http backend with chunked encoding.\n\nSigned-off-by: Tay Ray Chuan <rctay89@gmail.com>\n---\n remote-curl.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/remote-curl.c b/remote-curl.c\nindex 69eaf58..a331bae 100644\n--- a/remote-curl.c\n+++ b/remote-curl.c\n@@ -307,7 +307,7 @@ static size_t rpc_out(void *ptr, size_t eltsize,\n \t\trpc->len = avail;\n \t}\n\n-\tif (max < avail);\n+\tif (max < avail)\n \t\tavail = max;\n \tmemcpy(ptr, rpc->buf + rpc->pos, avail);\n \trpc->pos += avail;\n--\n1.6.4.4\n"},{"id":"128225","messageId":"20091124103130.e1bdf09f.rctay89@gmail.com","threadId":"21720","inReplyTo":"20091124095508.d6312ab0.rctay89@gmail.com","subject":"[PATCH v3] remote-curl.c: fix rpc_out()","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2009-11-24T02:31:30Z","receivedAt":"2009-11-24T02:31:30Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Remove the extraneous semicolon (';') at the end of the if statement\nthat allowed the code in its block to execute regardless of the\ncondition.\n\nThis fixes pushing to a smart http backend with chunked encoding.\n\nSigned-off-by: Tay Ray Chuan <rctay89@gmail.com>\n---\n\n  Reworded the part on code execution, so that it doesn't say \"the code\n  doesn't execute\", but rather \"the code always executes\".\n\n  Thanks to Paul for spotting that.\n\n remote-curl.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/remote-curl.c b/remote-curl.c\nindex 69eaf58..a331bae 100644\n--- a/remote-curl.c\n+++ b/remote-curl.c\n@@ -307,7 +307,7 @@ static size_t rpc_out(void *ptr, size_t eltsize,\n \t\trpc->len = avail;\n \t}\n\n-\tif (max < avail);\n+\tif (max < avail)\n \t\tavail = max;\n \tmemcpy(ptr, rpc->buf + rpc->pos, avail);\n \trpc->pos += avail;\n--\n1.6.4.4\n"},{"id":"128265","messageId":"20091124224331.GK11919@spearce.org","threadId":"21720","inReplyTo":"20091124103130.e1bdf09f.rctay89@gmail.com","subject":"Re: [PATCH v3] remote-curl.c: fix rpc_out()","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-11-24T22:43:31Z","receivedAt":"2009-11-24T22:43:31Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Tay Ray Chuan <rctay89@gmail.com> wrote:\n> Remove the extraneous semicolon (';') at the end of the if statement\n> that allowed the code in its block to execute regardless of the\n> condition.\n> \n> This fixes pushing to a smart http backend with chunked encoding.\n> \n> Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>\n\nAcked-by: Shawn O. Pearce <spearce@spearce.org>\n\nThanks for the fix, I can't believe I made this typo.  :-(\n\n> -\tif (max < avail);\n> +\tif (max < avail)\n>  \t\tavail = max;\n\n-- \nShawn.\n"}]}