Re: [PATCH 19/23] http-push.c::fetch_symref(): use the new http API
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Jun 5, 2009, 20:54 UTC
- Message-ID
- <m37hzq5rod.fsf@localhost.localdomain>
- In-Reply-To
- <20090606000559.483f22da.rctay89@gmail.com>
Tay Ray Chuan <rctay89@gmail.com> writes:
> From: Mike Hommey <mh@glandium.org> > Subject: [WIP Patch 09/12] Use the new http API in fetch_symref()
What is the subject of this patch: "http-push.c::fetch_symref(): use the new http API" or "Use the new http API in fetch_symref()"
Show 5 quoted lines
> Date: Sun, 18 Jan 2009 09:04:34 +0100 > > Signed-off-by: Mike Hommey <mh@glandium.org> > Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> > ---
If you wanted to note old subject, it would be better to put it in comments (here).
Show 41 quoted lines
> http-push.c | 20 +++-----------------
> 1 files changed, 3 insertions(+), 17 deletions(-)
>
> diff --git a/http-push.c b/http-push.c
> index 455e0aa..1714e4e 100644
> --- a/http-push.c
> +++ b/http-push.c
> @@ -2029,27 +2029,13 @@ static void fetch_symref(const char *path, char **symref, unsigned char *sha1)
> {
> char *url;
> struct strbuf buffer = STRBUF_INIT;
> - struct active_request_slot *slot;
> - struct slot_results results;
>
> url = xmalloc(strlen(repo->url) + strlen(path) + 1);
> sprintf(url, "%s%s", repo->url, path);
>
> - slot = get_active_slot();
> - slot->results = &results;
> - curl_easy_setopt(slot->curl, CURLOPT_FILE, &buffer);
> - curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, fwrite_buffer);
> - curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, NULL);
> - curl_easy_setopt(slot->curl, CURLOPT_URL, url);
> - if (start_active_slot(slot)) {
> - run_active_slot(slot);
> - if (results.curl_result != CURLE_OK) {
> - die("Couldn't get %s for remote symref\n%s",
> - url, curl_errorstr);
> - }
> - } else {
> - die("Unable to start remote symref request");
> - }
> + if (http_get_strbuf(url, &buffer, 0) != HTTP_OK)
> + die("Couldn't get %s for remote symref\n%s", url,
> + curl_errorstr);
> free(url);
>
> free(*symref);
> --
> 1.6.3.1
> -- Jakub Narebski Poland ShadeHawk on #git