{"thread":{"id":"19696","subject":"[PATCH 18/23] http-push.c::remote_exists(): use the new http API","startedAt":"2009-06-05T16:05:57Z","lastAt":"2009-06-06T01:03:04Z","messageCount":3,"participants":["Tay Ray Chuan","Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":23},"messages":[{"id":"115532","messageId":"20090606000557.18c55768.rctay89@gmail.com","threadId":"19696","inReplyTo":null,"subject":"[PATCH 18/23] http-push.c::remote_exists(): use the new http API","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2009-06-05T16:05:57Z","receivedAt":"2009-06-05T16:05:57Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"From:\tMike Hommey <mh@glandium.org>\nSubject: [WIP Patch 08/12] Use the new http API in update_remote_info_refs()\nDate:\tSun, 18 Jan 2009 09:04:33 +0100\n\nSigned-off-by: Mike Hommey <mh@glandium.org>\nSigned-off-by: Tay Ray Chuan <rctay89@gmail.com>\n---\n http-push.c |   31 ++++++++++++-------------------\n 1 files changed, 12 insertions(+), 19 deletions(-)\n\ndiff --git a/http-push.c b/http-push.c\nindex b01db75..455e0aa 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -2005,29 +2005,22 @@ static void update_remote_info_refs(struct remote_lock *lock)\n static int remote_exists(const char *path)\n {\n \tchar *url = xmalloc(strlen(repo->url) + strlen(path) + 1);\n-\tstruct active_request_slot *slot;\n-\tstruct slot_results results;\n-\tint ret = -1;\n+\tint ret;\n\n \tsprintf(url, \"%s%s\", repo->url, path);\n\n-\tslot = get_active_slot();\n-\tslot->results = &results;\n-\tcurl_easy_setopt(slot->curl, CURLOPT_URL, url);\n-\tcurl_easy_setopt(slot->curl, CURLOPT_NOBODY, 1);\n-\n-\tif (start_active_slot(slot)) {\n-\t\trun_active_slot(slot);\n-\t\tif (results.http_code == 404)\n-\t\t\tret = 0;\n-\t\telse if (results.curl_result == CURLE_OK)\n-\t\t\tret = 1;\n-\t\telse\n-\t\t\tfprintf(stderr, \"HEAD HTTP error %ld\\n\", results.http_code);\n-\t} else {\n-\t\tfprintf(stderr, \"Unable to start HEAD request\\n\");\n+\tswitch (http_get_strbuf(url, NULL, 0)) {\n+\tcase HTTP_OK:\n+\t\tret = 1;\n+\t\tbreak;\n+\tcase HTTP_MISSING_TARGET:\n+\t\tret = 0;\n+\t\tbreak;\n+\tcase HTTP_ERROR:\n+\t\thttp_error(url, HTTP_ERROR);\n+\tdefault:\n+\t\tret = -1;\n \t}\n-\n \tfree(url);\n \treturn ret;\n }\n--\n1.6.3.1\n"},{"id":"115568","messageId":"m33aae5rn2.fsf@localhost.localdomain","threadId":"19696","inReplyTo":"20090606000557.18c55768.rctay89@gmail.com","subject":"Re: [PATCH 18/23] http-push.c::remote_exists(): use the new http API","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-06-05T20:54:54Z","receivedAt":"2009-06-05T20:54:54Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Tay Ray Chuan <rctay89@gmail.com> writes:\n\n> From:\tMike Hommey <mh@glandium.org>\n> Subject: [WIP Patch 08/12] Use the new http API in update_remote_info_refs()\n\nWhat is the subject of this patch:\n  \"http-push.c::remote_exists(): use the new http API\"\nor\n  \"Use the new http API in update_remote_info_refs()\"?\n\n> Date:\tSun, 18 Jan 2009 09:04:33 +0100\n> \n> Signed-off-by: Mike Hommey <mh@glandium.org>\n> Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"115586","messageId":"be6fef0d0906051803w7be60788vc48752350d578308@mail.gmail.com","threadId":"19696","inReplyTo":"m33aae5rn2.fsf@localhost.localdomain","subject":"Re: [PATCH 18/23] http-push.c::remote_exists(): use the new http API","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2009-06-06T01:03:04Z","receivedAt":"2009-06-06T01:03:04Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Hi,\n\nOn Sat, Jun 6, 2009 at 4:54 AM, Jakub Narebski<jnareb@gmail.com> wrote:\n> What is the subject of this patch:\n>  \"http-push.c::remote_exists(): use the new http API\"\n> or\n>  \"Use the new http API in update_remote_info_refs()\"?\n\nSee my reply to patch #19.\n\n-- \nCheers,\nRay Chuan\n"}]}