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