From: Junio C Hamano Date: Mon, 01 Oct 2012 23:20:51 GMT Subject: Re: [PATCH] Retry HTTP requests on SSL connect failures Message-ID: <7vobklaiek.fsf@alter.siamese.dyndns.org> In-Reply-To: <20121001222306.GB12496@sigill.intra.peff.net> Jeff King writes: > On Mon, Oct 01, 2012 at 02:53:17PM -0700, Junio C Hamano wrote: > >> "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? > > I _think_ so. It seems that at the beginning of curl_multi_add_handle() there is a check to see if the incoming slot->curl has already been added to some curl-multi-handle and the function would return an error code CURLM_BAD_EASY_HANDLE without doing anything useful. Doesn't the second attempt to call start_active_slot() set the slot->in_use to zero and return false, skipping the call to run_active_slot() in that case?