Hi op.

On Fri, 25 Aug 2023 20:14:37 +0200
Omar Polo <o...@omarpolo.com> wrote:

> On 2023/08/25 09:07:35 -0600, "Theo de Raadt" <dera...@openbsd.org> wrote:
> > Pietro Cerutti <g...@gahr.ch> wrote:
> > 
> > > The motivation is that several network protocols are line oriented
> > > with CRLF as line terminators. SMTP and HTTP are among the most
> > > popular.
> > 
> > Yet, all servers of those protocols and and will accept the simpler 1-byte
> > line terminator.
> 
> Not http at least.  Try nc www.openbsd.org 80 and type an http
> request, httpd(8) will be happily waiting for a \r.
> 
> opensmtpd is less picky and is happy with just a line feed.
> 
> (I don't have any opinion on adding a flag.  To be fair, even if it
> were added I would probably forget and just use ^V^M^M instead of RET
> to terminate the lines when manually testing something.)
> 

I don't have any skin in this game. However, It's obvious to me that nc 
shouldn't
deal with protocol-specific things and adding flags to it to accomodate such 
behaviour
just feels wrong.

Netcat is, purely, a transport tool, it is not netcat business if a bunch of 
bytes
written in it's stdin, or whatever, terminates with '\r\n', or just '\n'.

Reply via email to