Skip to content

Commit

Permalink
Work around curl-gnutls not liking to be reinitialized
Browse files Browse the repository at this point in the history
curl versions 7.16.3 to 7.18.0 included had a regression in which https
requests following curl_global_cleanup/init sequence would fail with ASN1
parser errors with curl-gnutls. Such sequences happen in some cases such
as git fetch.

We work around this by removing the http_init and http_cleanup calls from
get_refs_via_curl, replacing them with a transport->data initialization
with the http_walker (which does http_init).

While the http_walker is not currently used in get_refs_via_curl, http
and walker code refactor will make it use it.

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Mike Hommey authored and Junio C Hamano committed Feb 10, 2008
1 parent 2b84b5a commit 9fd9279
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,11 +441,12 @@ static struct ref *get_refs_via_curl(struct transport *transport)
struct ref *ref = NULL;
struct ref *last_ref = NULL;

if (!transport->data)
transport->data = get_http_walker(transport->url);

refs_url = xmalloc(strlen(transport->url) + 11);
sprintf(refs_url, "%s/info/refs", transport->url);

http_init();

slot = get_active_slot();
slot->results = &results;
curl_easy_setopt(slot->curl, CURLOPT_FILE, &buffer);
Expand Down Expand Up @@ -473,8 +474,6 @@ static struct ref *get_refs_via_curl(struct transport *transport)
return NULL;
}

http_cleanup();

data = buffer.buf;
start = NULL;
mid = data;
Expand Down

0 comments on commit 9fd9279

Please sign in to comment.