From: Junio C Hamano Date: Wed, 02 Nov 2011 21:26:30 GMT Subject: Re: [PATCH 1/2] http.c: Use curl_multi_fdset to select on curl fds instead of just sleeping Message-ID: <7vehxqi5bt.fsf@alter.siamese.dyndns.org> In-Reply-To: <20111102203543.GC5628@sigill.intra.peff.net> Jeff King writes: > On Wed, Nov 02, 2011 at 04:32:21PM -0400, Jeff King wrote: > >> At least that's my reading. I am working on unrelated patches that clean >> up the handling of data_received, but if it could go away altogether, >> that would be even simpler. > > That patch, btw, looks like this: > > -- >8 -- > Subject: [PATCH] http: remove "local" member from slot struct > > The curl-multi http code does something like this: > > while (!finished) { > try_to_read_from_slots(); > if (!data_received) > wait_for_50_ms(); > } > > ... > Let's do the same thing for the write-to-file case as we do > for the write-to-strbuf case: use a thin wrapper callback > and increment the received flag. This makes both methods > consistent with each other, and saves us from managing the > "local" struct member at all, reducing the code size. Looks very sensible.