public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" <lavr@ncbi.nlm.nih.gov>
To: Takashi Yano <takashi.yano@nifty.ne.jp>,
	"cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: RE: [EXTERNAL] Re: scp stalls on uploading in cygwin 3.5 current master.
Date: Sat, 26 Aug 2023 14:08:34 +0000	[thread overview]
Message-ID: <DM8PR09MB70951B220E8E94793560EB8EA5E2A@DM8PR09MB7095.namprd09.prod.outlook.com> (raw)
In-Reply-To: <20230826042924.53b49a9f8372a9196a151425@nifty.ne.jp>

> > Can we use send(sock, "", 0) to reenable FD_WRITE, perhaps?
> 
> Your idea seems to work. The following patch looks to solve the issue.
> Is it supposed to be any side effect()?

IMO you're triggering an undefined (or not well-defined) behavior, because of the murky status
of the byte count of 0.  It may work now, but it may not work in the future...

RETURN VALUE
       On  success,  the  number of bytes written is returned (zero indicates nothing was written).  On error, -1 is returned, and
       errno is set appropriately.

       If count is zero and fd refers to a regular file, then write() may return a failure status if one of the  errors  below  is
       detected.   If no errors are detected, 0 will be returned without causing any other effect.  If count is zero and fd refers
       to a file other than a regular file, the results are not specified.

Anton Lavrentiev
Contractor NIH/NLM/NCBI

P.S.

Think of the effects of "recv(sock, buf, 0)" along the lines: the only valid return values in this
case would be -1 and 0, whereas 0 [usually] means EOF, but would it be really meant in this case?


  reply	other threads:[~2023-08-26 14:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-23 21:05 Takashi Yano
2023-08-24  3:31 ` Takashi Yano
2023-08-24  8:59   ` Corinna Vinschen
2023-08-25  8:48     ` Takashi Yano
2023-08-25 10:50       ` Corinna Vinschen
2023-08-25 12:08         ` [EXTERNAL] " Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2023-08-25 12:23           ` Corinna Vinschen
2023-08-25 13:19             ` Corinna Vinschen
2023-08-25 23:27               ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2023-08-26 13:52                 ` Corinna Vinschen
2023-08-26 14:15                   ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2023-08-26 14:34                     ` Corinna Vinschen
2023-08-25 19:29         ` Takashi Yano
2023-08-26 14:08           ` Lavrentiev, Anton (NIH/NLM/NCBI) [C] [this message]
2023-08-26 23:41             ` [EXTERNAL] " Takashi Yano
2023-08-28 13:37               ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2023-08-28 13:46                 ` Takashi Yano
2023-08-28 14:07                   ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2023-08-28 14:20                     ` Takashi Yano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM8PR09MB70951B220E8E94793560EB8EA5E2A@DM8PR09MB7095.namprd09.prod.outlook.com \
    --to=lavr@ncbi.nlm.nih.gov \
    --cc=cygwin@cygwin.com \
    --cc=takashi.yano@nifty.ne.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).