From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from conssluserg-05.nifty.com (conssluserg-05.nifty.com [210.131.2.90]) by sourceware.org (Postfix) with ESMTPS id 384F33858C3B for ; Wed, 15 Sep 2021 11:54:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 384F33858C3B Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=nifty.ne.jp Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=nifty.ne.jp Received: from Express5800-S70 (z221123.dynamic.ppp.asahi-net.or.jp [110.4.221.123]) (authenticated) by conssluserg-05.nifty.com with ESMTP id 18FBsW1a025059 for ; Wed, 15 Sep 2021 20:54:32 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com 18FBsW1a025059 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.ne.jp; s=dec2015msa; t=1631706872; bh=k/yHbWDB7WA8571MWwly3RFetEARrKzjRy07lQG06EA=; h=Date:From:To:Subject:In-Reply-To:References:From; b=BLP9SI1d4F6lB9uZkZormDvmvAAmOnTP/9Rgucg0Yz2P4zttMmJ5/6g/JaPHn0PSD VI/RXxEx4cgVW/SzZNrHMjbvm0cyqxr91nQo2jeBUC8gRxWdHgU8ugatry2YHZjN1u tMAOSRe9x5FPd2RpBxlrjnHeYf0LkZpk5GmZl14lGvANAC8mh4xH5YPXsySI91wTyr CelMezUFItlSEYnwFWLPxLncy2JhY4q/sOkodMleIdGD9YsOLiFWK4wQXXl98WdyxA r552j2+yMNTNKAKXS1vxQcTxW0lKwyX2DEf14ub25/pMt2iTkZ4YJWT3jbz5q/Ulil iJKiXwwTkX90w== X-Nifty-SrcIP: [110.4.221.123] Date: Wed, 15 Sep 2021 20:54:33 +0900 From: Takashi Yano To: cygwin-developers@cygwin.com Subject: Re: cygrunsrv + sshd + rsync = 20 times too slow -- throttled? Message-Id: <20210915205433.014102a9c1204687135e1417@nifty.ne.jp> In-Reply-To: References: <20210914185623.0488635bf6d1e925baee5fe8@nifty.ne.jp> <20210914191924.5092f63762d62c88431b5313@nifty.ne.jp> <20210914210507.be6c950c948033704542bc42@nifty.ne.jp> <20210915092100.796985ae33039f3184483450@nifty.ne.jp> <20210915094454.42ef1d085d9bf92a1af8d39a@nifty.ne.jp> <20210915095911.415d174ea38fb2d2ea8e5432@nifty.ne.jp> <20210915194858.845bcd54c0c63246b40703a8@nifty.ne.jp> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin-developers@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component developers mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 11:54:53 -0000 On Wed, 15 Sep 2021 13:13:25 +0200 Corinna Vinschen wrote: > @@ -652,11 +652,15 @@ pipe_data_available (int fd, fhandler_base *fh, HANDLE h, bool writing) > } > /* TODO: Buffer really full or non-Cygwin reader? */ > } > - else if (fpli.ReadDataAvailable) > + else > { > - paranoid_printf ("fd %d, %s, read avail %u", fd, fh->get_name (), > - fpli.ReadDataAvailable); > - return 1; > + DWORD nbytes_in_pipe; > + if (PeekNamedPipe (h, NULL, 0, NULL, &nbytes_in_pipe, NULL)) > + { > + paranoid_printf ("fd %d, %s, read avail %u", fd, fh->get_name (), > + nbytes_in_pipe); > + return nbytes_in_pipe > 0; > + } > } > if (fpli.NamedPipeState & FILE_PIPE_CLOSING_STATE) > return -1; This shoudl be: @@ -652,11 +652,17 @@ pipe_data_available (int fd, fhandler_base *fh, HANDLE h, bool writing) } /* TODO: Buffer really full or non-Cygwin reader? */ } - else if (fpli.ReadDataAvailable) + else { - paranoid_printf ("fd %d, %s, read avail %u", fd, fh->get_name (), - fpli.ReadDataAvailable); - return 1; + DWORD nbytes_in_pipe; + if (PeekNamedPipe (h, NULL, 0, NULL, &nbytes_in_pipe, NULL)) + { + paranoid_printf ("fd %d, %s, read avail %u", fd, fh->get_name (), + nbytes_in_pipe); + return nbytes_in_pipe > 0; + } + else if (GetLastError () == ERROR_BROKEN_PIPE) + return -1; } if (fpli.NamedPipeState & FILE_PIPE_CLOSING_STATE) return -1; -- Takashi Yano