Re: A network-change detection and IPv6 quirk - on Windows

Daniel Stenberg <[email protected]> Thu, 25 Feb 2016 15:56:57 +0100 (CET)
Newsgroups gmane.comp.mozilla.devel.netlib
Message-ID <[email protected]>
On Thu, 25 Feb 2016, Honza Bambas wrote:

>> Adaptive keep-alive! I like that. Just a tad bit worried it'll introduce 
>> other problems as it'll then make _all_ transfers get that keepalive thing 
>> going at a fairly high frequency
>
> It doesn't need to be a super high frequency.  You will only enable it 
> between request sending and last response bit receive (complete).

Maybe we should then do this on each network-change-event?

1. read out the tcp keepalive state from the http/1 connection, if it is
    is "short lived", we let the default keepalive handling take care of itself
    and we're done. If not short-lived, continue

2. call nsHttpConnection::StartShortLivedTCPKeepalives() (which seems to have
    a default 'idle_time' set to 10 seconds)

3. set a timeout that is ShortLivedTCPKeepalive interval + some time

4. when the timeout triggers, restore the original keepalive state from (1)
    (which I presume is either long-lived or disabled)

It should at least do less kills of actually used alive connections, although 
it will be slower to kill actually dead connections.

-- 

  / daniel.haxx.se