Fix potential hang in https handshake.

2012-10-18 Thread szager
>From 700b8075c578941c8f951711825c390ac68b190f Mon Sep 17 00:00:00 2001 From: Stefan Zager Date: Thu, 18 Oct 2012 14:03:59 -0700 Subject: [PATCH] Fix potential hang in https handshake. It will sometimes happen that curl_multi_fdset() doesn't return any file descriptors. In that ca

Re: Fix potential hang in https handshake.

2012-10-18 Thread Junio C Hamano
sza...@google.com writes: > From 700b8075c578941c8f951711825c390ac68b190f Mon Sep 17 00:00:00 2001 > From: Stefan Zager > Date: Thu, 18 Oct 2012 14:03:59 -0700 > Subject: [PATCH] Fix potential hang in https handshake. > > It will sometimes happen that curl_multi_fdset() doesn&#

Fix potential hang in https handshake (v2).

2012-10-18 Thread szager
>From aa77ab3dd5b98a5786ac158528f45355fc0ddbc3 Mon Sep 17 00:00:00 2001 From: Stefan Zager Date: Thu, 18 Oct 2012 16:23:53 -0700 Subject: [PATCH] Fix potential hang in https handshake. It will sometimes happen that curl_multi_fdset() doesn't return any file descriptors. In that ca

Re: Fix potential hang in https handshake.

2012-10-19 Thread Jeff King
On Thu, Oct 18, 2012 at 03:59:41PM -0700, Junio C Hamano wrote: > > It will sometimes happen that curl_multi_fdset() doesn't > > return any file descriptors. In that case, it's recommended > > that the application sleep for a short time before running > > curl_multi_perform() again. > > > > http:

Re: Fix potential hang in https handshake.

2012-10-19 Thread Shawn Pearce
On Fri, Oct 19, 2012 at 3:36 AM, Jeff King wrote: > On Thu, Oct 18, 2012 at 03:59:41PM -0700, Junio C Hamano wrote: > >> > It will sometimes happen that curl_multi_fdset() doesn't >> > return any file descriptors. In that case, it's recommended >> > that the application sleep for a short time bef

Re: Fix potential hang in https handshake.

2012-10-19 Thread Junio C Hamano
Stefan Zager writes: > On Oct 19, 2012 7:11 AM, "Shawn Pearce" wrote: >> >> The issue with the current code is sometimes when libcurl is opening a >> CONNECT style connection through an HTTP proxy it returns a crazy high >> timeout (>240 seconds) and no fds. In this case Git waits forever. >> St

Re: Fix potential hang in https handshake.

2012-10-19 Thread Daniel Stenberg
On Fri, 19 Oct 2012, Shawn Pearce wrote: The issue with the current code is sometimes when libcurl is opening a CONNECT style connection through an HTTP proxy it returns a crazy high timeout (>240 seconds) and no fds. In this case Git waits forever. Is this repeatable with a recent libcurl? I

Re: Fix potential hang in https handshake.

2012-10-19 Thread Jeff King
On Fri, Oct 19, 2012 at 07:10:46AM -0700, Shawn O. Pearce wrote: > > IOW, it seems like we are _already_ following the advice referenced in > > curl's manpage. Is there some case I am missing? Confused... > > The issue with the current code is sometimes when libcurl is opening a > CONNECT style c

Re: Fix potential hang in https handshake.

2012-10-19 Thread Stefan Zager
On Fri, Oct 19, 2012 at 1:27 PM, Jeff King wrote: > > On Fri, Oct 19, 2012 at 07:10:46AM -0700, Shawn O. Pearce wrote: > > > > IOW, it seems like we are _already_ following the advice referenced in > > > curl's manpage. Is there some case I am missing? Confused... > > > > The issue with the curren

Re: Fix potential hang in https handshake.

2012-10-19 Thread Jeff King
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); > >

Re: Fix potential hang in https handshake.

2012-10-19 Thread Junio C Hamano
Jeff King writes: > On Fri, Oct 19, 2012 at 07:10:46AM -0700, Shawn O. Pearce wrote: > >> > IOW, it seems like we are _already_ following the advice referenced in >> > curl's manpage. Is there some case I am missing? Confused... >> >> The issue with the current code is sometimes when libcurl is

Fix potential hang in https handshake (v3)

2012-10-19 Thread szager
>From 32e06128dbc97ceb0d060c88ec8db204fa51be5c Mon Sep 17 00:00:00 2001 From: Stefan Zager Date: Thu, 18 Oct 2012 16:23:53 -0700 Subject: [PATCH] Fix potential hang in https handshake. It has been observed that curl_multi_timeout may return a very long timeout value (e.g., 294 seconds and s

[PATCH] Fix potential hang in https handshake.

2012-10-19 Thread szager
It has been observed that curl_multi_timeout may return a very long timeout value (e.g., 294 seconds and some usec) just before curl_multi_fdset returns no file descriptors for reading. The upshot is that select() will hang for a long time -- long enough for an https handshake to be dropped. The

Re: Fix potential hang in https handshake (v2).

2012-10-18 Thread Junio C Hamano
sza...@google.com writes: > From aa77ab3dd5b98a5786ac158528f45355fc0ddbc3 Mon Sep 17 00:00:00 2001 > From: Stefan Zager > Date: Thu, 18 Oct 2012 16:23:53 -0700 > Subject: [PATCH] Fix potential hang in https handshake. Please don't do the above (as usual ;-) > It will s

Re: Fix potential hang in https handshake (v2).

2012-10-18 Thread Junio C Hamano
Junio C Hamano writes: > We end up calling select() without any bit set in fds, so it would > become micro-sleep of select_timeout in such a case, but as far as I > can see, the existing code either > > * does not select() and keeps polling step_active_slots() without >delay, when curl_timeo

Re: Fix potential hang in https handshake (v3)

2012-10-19 Thread Jeff King
On Fri, Oct 19, 2012 at 02:04:20PM -0700, sza...@google.com wrote: > From 32e06128dbc97ceb0d060c88ec8db204fa51be5c Mon Sep 17 00:00:00 2001 > From: Stefan Zager > Date: Thu, 18 Oct 2012 16:23:53 -0700 Drop these lines. > Subject: [PATCH] Fix potential hang in https handshake. A

Re: Fix potential hang in https handshake (v3)

2012-10-19 Thread Junio C Hamano
Jeff King writes: >> +if (max_fd < 0 && >> +select_timeout.tv_sec > 0 || >> +select_timeout.tv_usec > 5) { >> +select_timeout.tv_sec = 0; >> +select_timeout.tv_usec = 5

Re: [PATCH] Fix potential hang in https handshake.

2012-10-19 Thread Junio C Hamano
Thanks. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html