On Tue, Mar 19, 2013 at 03:16:50PM -0400, Ted Unangst wrote:
> OK, thanks, I think I get it. Let me summarize:
>
> nc currently calls shutdown() when it gets EOF on input. This is the
> right thing to do, because that's how well written network clients
> indicate end of input. Some broken servers, however, treat shutdown as
> a disconnect and abort the connection.
Right.
>
> nc does not have a bug, but as a practical matter, it would be nice to
> interoperate with buggy servers. To that end, an option to disable the
> default shutdown() behavior is proposed.
>
> End of summary. Correct so far?
Yes, but there is another thing also: gnu netcat. It does not do a
shutdown. I think in this case it would be a good thing to be
compatible.
>
> Now that I better understand the problem, something like the -q
> [delay] option seems like the better solution. Even when talking to a
> broken server, we don't necessarily want nc hanging around forever,
> and maybe we don't know if the server is broken or not. So calling
> shutdown after a delay will work in the greatest number of cases,
> correct?
What would be the behaviour without -q N in your proposal?
-Otto