From: Jeff King <peff@peff.net>
To: Stefan Zager <szager@google.com>
Cc: Shawn Pearce <spearce@spearce.org>,
Junio C Hamano <gitster@pobox.com>,
git@vger.kernel.org, Shawn Pearce <sop@google.com>
Subject: Re: Fix potential hang in https handshake.
Date: Fri, 19 Oct 2012 16:40:35 -0400 [thread overview]
Message-ID: <20121019204035.GA24448@sigill.intra.peff.net> (raw)
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:
> > 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
next prev parent reply other threads:[~2012-10-19 20:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-18 21:35 Fix potential hang in https handshake szager
2012-10-18 22:59 ` Junio C Hamano
2012-10-19 10:36 ` Jeff King
2012-10-19 14:10 ` Shawn Pearce
[not found] ` <CAHOQ7J9W8FdKqzqbuDqj4bcFyN02kUigWtbL_xCen-PYWF9LUg@mail.gmail.com>
2012-10-19 17:02 ` Junio C Hamano
2012-10-19 17:08 ` Daniel Stenberg
2012-10-19 20:27 ` Jeff King
2012-10-19 20:37 ` Stefan Zager
2012-10-19 20:40 ` Jeff King [this message]
2012-10-19 20:40 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121019204035.GA24448@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=sop@google.com \
--cc=spearce@spearce.org \
--cc=szager@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).