{"thread":{"id":"19593","subject":"[PATCH 13/17] http-push.c::fetch_symref(): use the new http API","startedAt":"2009-05-29T17:59:33Z","lastAt":"2009-05-29T17:59:33Z","messageCount":1,"participants":["Tay Ray Chuan"],"isPatch":true,"patchVersion":1,"patchTotal":17},"messages":[{"id":"115035","messageId":"20090530015933.030ad46b.rctay89@gmail.com","threadId":"19593","inReplyTo":null,"subject":"[PATCH 13/17] http-push.c::fetch_symref(): use the new http API","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2009-05-29T17:59:33Z","receivedAt":"2009-05-29T17:59:33Z","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 09/12] Use the new http API in fetch_symref()\nDate:\tSun, 18 Jan 2009 09:04:34 +0100\n\nSigned-off-by: Mike Hommey <mh@glandium.org>\nSigned-off-by: Tay Ray Chuan <rctay89@gmail.com>\n---\n http-push.c |   20 +++-----------------\n 1 files changed, 3 insertions(+), 17 deletions(-)\n\ndiff --git a/http-push.c b/http-push.c\nindex 5b20cec..7aa4fc4 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -2024,27 +2024,13 @@ static void fetch_symref(const char *path, char **symref, unsigned char *sha1)\n {\n \tchar *url;\n \tstruct strbuf buffer = STRBUF_INIT;\n-\tstruct active_request_slot *slot;\n-\tstruct slot_results results;\n\n \turl = xmalloc(strlen(repo->url) + strlen(path) + 1);\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_FILE, &buffer);\n-\tcurl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, fwrite_buffer);\n-\tcurl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, NULL);\n-\tcurl_easy_setopt(slot->curl, CURLOPT_URL, url);\n-\tif (start_active_slot(slot)) {\n-\t\trun_active_slot(slot);\n-\t\tif (results.curl_result != CURLE_OK) {\n-\t\t\tdie(\"Couldn't get %s for remote symref\\n%s\",\n-\t\t\t    url, curl_errorstr);\n-\t\t}\n-\t} else {\n-\t\tdie(\"Unable to start remote symref request\");\n-\t}\n+\tif (http_get_strbuf(url, &buffer, 0) != HTTP_OK)\n+\t\tdie(\"Couldn't get %s for remote symref\\n%s\", url,\n+\t\t    curl_errorstr);\n \tfree(url);\n\n \tfree(*symref);\n--\n1.6.3.1\n"}]}