Date: Sun, 21 Jul 2013 19:50:46 -0700 From: Adrian Chadd <adrian@freebsd.org> To: "Ronald F. Guilmette" <rfg@tristatelogic.com> Cc: freebsd-hackers@freebsd.org Subject: Re: bin/176713: [patch] nc(1) closes network socket too soon Message-ID: <CAJ-VmonDfzG7H1pPOxt%2BPTpdigrzuGe8di8zhoUsLGi3cGZAXA@mail.gmail.com> In-Reply-To: <91998.1374458546@server1.tristatelogic.com> References: <CAJ-VmomyAi51VDzFh=QzbtT4EBsvsP4BocoE9-7Ca44Z1tcCGA@mail.gmail.com> <91998.1374458546@server1.tristatelogic.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 21 July 2013 19:02, Ronald F. Guilmette <rfg@tristatelogic.com> wrote: > It has been some time now since I filed my PR but I think that the bottom > line is that you need to look at the code (of nc) to understand how it is > reacting to EOF on stdin. Gah, I was kinda hoping not to look at nc, and just work with someone else to figure out the right solution. I'm being slack :) > My recollection is that it exits as soon as it sees that (i.e. EOF on > its own stdin). My proposed patch corrects this unfortunate behavior. OK. Let me re-read this. I _think_ the correct behaviour is: * if it's done a shutdown(fd, WR) - then it shouldn't error out on EOF events on writes to the FD * But it shouldn't get a read EOF on the socket until the remote side signifies it. Is nc seeing EOF on reading form the server side prematurely? That's why I'm confused. -adrian
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-VmonDfzG7H1pPOxt%2BPTpdigrzuGe8di8zhoUsLGi3cGZAXA>