@matheusbsbs / matheus-bagliano / commits / 9fd9279bf6
Fork 0

Work around curl-gnutls not liking to be reinitialized

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>

Mike Hommey committed Feb 9, 2008 at 10:41 UTC 9fd9279bf60e1c31149000ae309a28d85d2a88e1
1 file changed +3 -4
transport.c
+3 -4
@@ -441,11 +441,12 @@ static struct ref *get_refs_via_curl(struct transport *transport)
441 struct ref *ref = NULL;
442 struct ref *last_ref = NULL;
443
444 + if (!transport->data)
445 + transport->data = get_http_walker(transport->url);
446 +
447 refs_url = xmalloc(strlen(transport->url) + 11);
448 sprintf(refs_url, "%s/info/refs", transport->url);
449
447 - http_init();
448 -
450 slot = get_active_slot();
451 slot->results = &results;
452 curl_easy_setopt(slot->curl, CURLOPT_FILE, &buffer);
@@ -473,8 +474,6 @@ static struct ref *get_refs_via_curl(struct transport *transport)
474 return NULL;
475 }
476
476 - http_cleanup();
477 -
477 data = buffer.buf;
478 start = NULL;
479 mid = data;