cygrunsrv + sshd + rsync = 20 times too slow -- throttled?

Takashi Yano takashi.yano@nifty.ne.jp
Thu Sep 16 00:13:24 GMT 2021


On Wed, 15 Sep 2021 12:22:58 -0400
Ken Brown wrote:
> diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
> index 566cf66d6..cdb213a42 100644
> --- a/winsup/cygwin/select.cc
> +++ b/winsup/cygwin/select.cc
> @@ -645,7 +645,7 @@ pipe_data_available (int fd, fhandler_base *fh, HANDLE h, 
> bool writing)
>              return 1; /* We cannot know actual write pipe space. */
>            DWORD nbytes_in_pipe;
>            if (!PeekNamedPipe (query_hdl, NULL, 0, NULL, &nbytes_in_pipe, NULL))
> -           return 1;
> +           return -1;
>            fpli.WriteQuotaAvailable = fpli.InboundQuota - nbytes_in_pipe;
>          }
>         if (fpli.WriteQuotaAvailable > 0)

I think this is not correct. IIUC, return value -1 means that the
other side of pipe is closed. However, in this case, NtQueryInformationFile
is succeeded previously. So the other side of pipe is still alive. I cannot
imagine when PeekNamedPipe fails, however, if query_hdl is lost accidentally,
returning 1 is the correct thing just as the case query_hdl == NULL.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>


More information about the Cygwin-developers mailing list