From: Junio C Hamano Date: Mon, 01 Oct 2012 21:53:17 GMT Subject: Re: [PATCH] Retry HTTP requests on SSL connect failures Message-ID: <7v1uhhc10y.fsf@alter.siamese.dyndns.org> In-Reply-To: <1349126586-755-1-git-send-email-spearce@spearce.org> "Shawn O. Pearce" writes: > + for (attempts = 0; attempts < 2; attempts++) { > + if (start_active_slot(slot)) { > + run_active_slot(slot); > + if (slot->results->curl_result == CURLE_SSL_CONNECT_ERROR) > + continue; Is it safe to continue and let start_active_slot() to add the same curl handle again when USE_CURL_MULTI is in effect? > + ret = handle_curl_result(slot); > + } else { > + error("Unable to start HTTP request for %s", url); > + ret = HTTP_START_FAILED; > + } > + break; > } > > curl_slist_free_all(headers); > diff --git a/remote-curl.c b/remote-curl.c > index a269608..04a379c 100644 > --- a/remote-curl.c > +++ b/remote-curl.c > @@ -353,6 +353,8 @@ static int run_slot(struct active_request_slot *slot) > > slot->results = &results; > slot->curl_result = curl_easy_perform(slot->curl); > + if (slot->curl_result == CURLE_SSL_CONNECT_ERROR) > + slot->curl_result = curl_easy_perform(slot->curl); > finish_active_slot(slot); > > err = handle_curl_result(slot);