git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] http.c: Use curl_multi_fdset to select on curl fds instead of just sleeping

From
Daniel Stenberg <daniel@haxx.se>
Date
Oct 29, 2011, 20:33 UTC
Message-ID
<alpine.DEB.2.00.1110292230500.28196@tvnag.unkk.fr>
In-Reply-To
<1319901621-482-1-git-send-email-mika.fischer@zoopnet.de>
On Sat, 29 Oct 2011, Mika Fischer wrote:
Show 5 quoted lines
> Previously, when nothing could be read from the connections curl had open, 
> git would just sleep unconditionally for 50ms. This patch changes this 
> behavior and instead obtains the recommended timeout and the actual file 
> descriptors from curl. This should eliminate time spent sleeping when data 
> could actually be read/written on the socket.

It looks fine to me, from a libcurl perspective. I only have one comment about this:

> +			curl_multi_fdset(curlm, &readfds, &writefds, &excfds, &max_fd);
> +
> +			select(max_fd+1, &readfds, &writefds, &excfds, &select_timeout);

At times, curl_multi_fdset() might return -1 in max_fd, as when there's no internal socket around to provide to the application to wait for.

Calling select() with max_fd+1 (== 0) will then not be appreciated by all implementations of select() so that case should probably also be covered by the 50ms sleep approach...

-- 
  / daniel.haxx.se
Previous: Mika FischerNext: Mika Fischer
Message 2 of 5 in “http.c: Use curl_multi_fdset to select on curl fds instead of just sleeping”
  1. http.c: Use curl_multi_fdset to select on curl fds instead of just sleepingMika Fischer, Oct 29, 2011
  2. Daniel StenbergOct 29, 2011
  3. Mika FischerOct 30, 2011
  4. Mika FischerNov 2, 2011
  5. Junio C HamanoNov 2, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.