delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/06/30/09:47:58

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 38E2C386184F
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1593524832;
bh=Y7/ZTAAu15518TljlyqRuMv1oH41kRosvpFeSQ/MPYY=;
h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=AMMnMrWVPpqeOusGWck0yiXEjRQnz9RMXQqvlMFoDJ84ymr47F20OYpAvqYQL4SJ3
INPdp0h+3S24UJAO9y1E9QWD9NfiR1P3j+oAKDkKIeuPR7GrPt0tg36SI6VvI0vZA/
vcVSNfGIuzotDaPo35bBt9TYVFv3qY9UTB/f6whI=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D7CD53851C19
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to;
bh=Sk5Zfqv3sW+k2wbLcireTxkU0HrievBPkAIPM8qe48A=;
b=Xog6d9WQ5sY10MJ6UnBi3iMEQ2dTEX8pWyi+vvtiLAsllbA7VcIjiLfBn+IR+YAD4X
bcGrMsAjdoDXtIrOiX+3X34/heysjEg3P6YJzdUP/c3uRtASkWpTeWeXOVHt7HC0kDGQ
AzGGVd+BJBKGcwFvT5s1+UlXaEmRsy1y8MP775oJa1rgcHBBV8azfqpGKxdeLJLcuZHy
z3A+uKJgAB1CrQmInJZYqcJDq/KfB5IRY/AtJoYrauN5m4+gVUYPsk3sOckdngwfWvdy
EKRVf0jlGS/lm9RWdhZfLMi+6ucFR5UiuvHZSxJFHLwOIarATLHNwwolvp+MN2e2CyyB
7NXw==
X-Gm-Message-State: AOAM530tCaTlg/efwHQukzHcf8q7yLhwSQxr0sMObP84DY/chjw5URod
GhGmofYnqG5oAQvOYFqL+vCTvcJtJ2ooYTHw0IXUgB0p8GN6
X-Google-Smtp-Source: ABdhPJyKtI785NbJtmKTRSIUPtho+seBU6s98ezFx5RGMvfLLBe+YvTRF6pQB1I6iBfuyDLP68SG4zgs/mcsRqoUgiM=
X-Received: by 2002:a2e:8751:: with SMTP id q17mr5314106ljj.268.1593524827144;
Tue, 30 Jun 2020 06:47:07 -0700 (PDT)
MIME-Version: 1.0
References: <CAEF1h+WHsGXzSykQ0G3aXG=8jY5VmpYQQiYNP7DjHJTS1Bkpsw AT mail DOT gmail DOT com>
<ba71f855-276d-9d45-5c78-6d0a91dc57dd AT cornell DOT edu>
<CAEF1h+UuQmXz-ntG6YMed+DKFgikJT_aJN5Hu94ZnZ8_LGxMjQ AT mail DOT gmail DOT com>
<20200630111215 DOT GE3499 AT calimero DOT vinschen DOT de>
In-Reply-To: <20200630111215.GE3499@calimero.vinschen.de>
Date: Tue, 30 Jun 2020 09:46:56 -0400
Message-ID: <CAEF1h+Xm_KbsdyU2EUiCef8WAnDLn=avaNGC07uniYbgeT-GwQ@mail.gmail.com>
Subject: Re: TCP_KEEPINVTL and TCP_KEEPIDLE - Socket Keep Alives not working
To: cygwin AT cygwin DOT com, corinna-cygwin AT cygwin DOT com
X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE,
RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS,
TXREP autolearn=ham autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-Content-Filtered-By: Mailman/MimeDel 2.1.29
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <http://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Cary Lewis via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Cary Lewis <cary DOT lewis AT gmail DOT com>
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>

Thanks for the reply. The answer to your question is that the 2 hour keep
alive was not sufficient for a particular use case I encountered.

I was trying to use curl under cygwin to access a very slow REST endpoint
that was taking up to 8 minutes to generate download before any data flowed
back to the client. This caused the server to abort the socket.

Accessing the endpoint in chrome or firefox revealed that they set a
keepalive to 45 seconds, which kept the server happy.

Attempting to set --keepalive-time=45 in cygwin's curl didn't work, and
wireshark revealed that no keepalives were being sent.

I will attempt to patch cygwin, I got the build to work. Can you point me
in the right direction, in terms of where the socket calls get mapped to
the winsock calls?

On a separate note, what are your thoughts on the new windows WSL2 release?
Do you think this will have long term implications for cygwin?


On Tue, Jun 30, 2020 at 7:15 AM Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
wrote:

> On Jun  7 14:56, Cary Lewis via Cygwin wrote:
> > Thanks very much for the reply - I will wait for Corinna's take on this
> as
> > well - the patch shouldn't be too hard.
>
> It's not that easy, but not too hard either:
>
> - Windows 10 1709 and later actually support the TCP_KEEPIDLE,
>   TCP_KEEPINTVL and TCP_KEEPCNT options natively, so all is fine here.
>
> - Older OS versions require the use of a single call
>   WSAIoctl(SIO_KEEPALIVE_VALS), while TCP_KEEPIDLE, TCP_KEEPINTVL and
>   TCP_KEEPCNT are three distinct calls, with TCP_KEEPCNT being no-op on
>   pre W10 1709.
>
> > In fact the source code for curl in the lib/connect.c file has code to
> > enable the winsock options, so hopefully that code could be helpful. I
>
> But, here's the question:
>
> Even if neither one of SIO_KEEPALIVE_VALS, TCP_KEEPIDLE, TCP_KEEPINTVL
> and TCP_KEEPCNT are available, curl *still* uses SO_KEEPALIVE to enable
> TCP keep-alive.  Given TCP keep-alive has default settings on Windows,
> too (2 hours, 1 sec, 10 times), and given SO_KEEPALIVE is supported on
> Cygwin as well, why isn't that sufficient?
>
> Keep in mind that none of the above WSAIoctl/setsockopt options are
> portable, only SO_KEEPALIVE is.  So why should that work on, say,
> Solaris, but not on Windows?
>
>
> Corinna
>
> --
> Corinna Vinschen
> Cygwin Maintainer
> --
> Problem reports:      https://cygwin.com/problems.html
> FAQ:                  https://cygwin.com/faq/
> Documentation:        https://cygwin.com/docs.html
> Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
>
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019