[PATCH v4] Work around curl-gnutls not liking to be reinitialized

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git@...>, <gitster@...>
Date: Saturday, February 9, 2008 - 5:41 am

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>
---
 FWIW, the previous patch lacked an initialization for pragma_header. But I
 actually got a better idea ; a more long-term one.

 transport.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/transport.c b/transport.c
index babaa21..497f853 100644
--- a/transport.c
+++ b/transport.c
@@ -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);
@@ -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;
-- 
1.5.4.35.gb88c

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: git-fetch in 1.5.4 fails versus 1.5.3.8, Anand Kumria, (Thu Feb 7, 6:15 am)
Re: git-fetch in 1.5.4 fails versus 1.5.3.8, Dmitry Potapov, (Thu Feb 7, 7:23 pm)
Re: git-fetch in 1.5.4 fails versus 1.5.3.8, Frank Lichtenheld, (Thu Feb 7, 10:23 am)
Re: git-fetch in 1.5.4 fails versus 1.5.3.8, Linus Torvalds, (Thu Feb 7, 2:42 pm)
Re: git-fetch in 1.5.4 fails versus 1.5.3.8, Jeff King, (Thu Feb 7, 4:40 pm)
Re: git-fetch in 1.5.4 fails versus 1.5.3.8, Linus Torvalds, (Thu Feb 7, 5:01 pm)
Re: git-fetch in 1.5.4 fails versus 1.5.3.8, Jeff King, (Thu Feb 7, 6:40 pm)
Re: git-fetch in 1.5.4 fails versus 1.5.3.8, Dmitry Potapov, (Thu Feb 7, 5:53 pm)
Re: git-fetch in 1.5.4 fails versus 1.5.3.8, Jeff King, (Thu Feb 7, 6:46 pm)
Re: git-fetch in 1.5.4 fails versus 1.5.3.8, Martin Langhoff, (Thu Feb 7, 5:47 pm)
Re: git-fetch in 1.5.4 fails versus 1.5.3.8, Frank Lichtenheld, (Thu Feb 7, 4:14 pm)
Re: git-fetch in 1.5.4 fails versus 1.5.3.8, Linus Torvalds, (Thu Feb 7, 4:54 pm)
Re: git-fetch in 1.5.4 fails versus 1.5.3.8, Anand Kumria, (Thu Feb 7, 5:36 pm)
Re: git-fetch in 1.5.4 fails versus 1.5.3.8, Jeff King, (Thu Feb 7, 7:06 am)
Re: git-fetch in 1.5.4 fails versus 1.5.3.8, Mike Hommey, (Thu Feb 7, 8:10 am)
Re: git-fetch in 1.5.4 fails versus 1.5.3.8, Jeff King, (Thu Feb 7, 8:28 am)
Re: git-fetch in 1.5.4 fails versus 1.5.3.8, Mike Hommey, (Thu Feb 7, 6:02 pm)
Re: git-fetch in 1.5.4 fails versus 1.5.3.8, Jeff King, (Thu Feb 7, 8:32 pm)
Re: git-fetch in 1.5.4 fails versus 1.5.3.8, Mike Hommey, (Fri Feb 8, 3:18 am)
Re: git-fetch in 1.5.4 fails versus 1.5.3.8, Mike Hommey, (Fri Feb 8, 3:34 am)
Re: [PATCH] Work around curl-gnutls not liking to be reiniti..., Johannes Schindelin, (Fri Feb 8, 5:53 pm)
Re: [PATCH v2] Work around curl-gnutls not liking to be rein..., Johannes Schindelin, (Fri Feb 8, 6:51 pm)
[PATCH v4] Work around curl-gnutls not liking to be reinitia..., Mike Hommey, (Sat Feb 9, 5:41 am)