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

Re: Fix potential hang in https handshake.

From
Jeff King <peff@peff.net>
Date
Oct 19, 2012, 20:40 UTC
Message-ID
<20121019204035.GA24448@sigill.intra.peff.net>
In-Reply-To
<CAHOQ7J8D-8++vgMh=c0rcTtAKrhWUCQx2nSd_spBzFe=QdXwBw@mail.gmail.com>
On Fri, Oct 19, 2012 at 01:37:06PM -0700, Stefan Zager wrote:
Show 26 quoted lines
> > diff --git a/http.c b/http.c
> > index df9bb71..cd07cdf 100644
> > --- a/http.c
> > +++ b/http.c
> > @@ -631,6 +631,19 @@ void run_active_slot(struct active_request_slot *slot)
> >                         FD_ZERO(&excfds);
> >                         curl_multi_fdset(curlm, &readfds, &writefds, &excfds, &max_fd);
> >
> > +                       /*
> > +                        * Sometimes curl will give a really long timeout for a
> > +                        * CONNECT when there are no fds to read, but we can
> > +                        * get better results by running curl_multi_perform
> > +                        * more frequently.
> > +                        */
> > +                       if (maxfd < 0 &&
> > +                           (select_timeout.tv_sec > 0 ||
> > +                            select_timeout.tv_usec > 50000)) {
> > +                               select_timeout.tv_sec = 0;
> > +                               select_timeout.tv_usec = 50000;
> > +                       }
> > +
> >                         select(max_fd+1, &readfds, &writefds, &excfds, &select_timeout);
> >                 }
> >         }
> >
> I have no objection to this; any one else?

If you wouldn't mind, I was hoping you could flesh out the comment a bit more with real details of when this happens (and/or put them in the commit message). If this is indeed a bug to be worked around, it will be a huge help to somebody reading this code in a year who can confirm that modern curl does not need it anymore.

-Peff
Previous: Stefan ZagerNext: Junio C Hamano
Message 8 of 10 in “Fix potential hang in https handshake.”
  1. szager@google.comOct 18, 2012
  2. Junio C HamanoOct 18, 2012
  3. Jeff KingOct 19, 2012
  4. Shawn PearceOct 19, 2012
  5. Daniel StenbergOct 19, 2012
  6. Jeff KingOct 19, 2012
  7. Stefan ZagerOct 19, 2012
  8. Jeff KingOct 19, 2012
  9. Junio C HamanoOct 19, 2012
  10. Junio C HamanoOct 19, 2012

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.