On 22.9. 12:50, dirk+b...@testssl.sh wrote:
cat has a problem with binary chars, right? And: see below.

No, it just loops with read() and write(), it shouldn't touch any of the bytes (except for cat -A and such). But it probably doesn't help in coalescing the write blocks, it's likely to just write() whatever it gets immediately.

And you can't really solve the issue at hand by piping to any intermediate program, as that program couldn't know how long to buffer the input. Unless you use something that buffers for a particular amount of time, which of course causes a unnecessary delay.

The coreutils printf seems to output 'foo\nbar\n' as a single write, though (unless it goes to the terminal, so the usual stdio buffering), so you might be able to use that.


In any case, if a TCP endpoint cares about getting full data packets within a single segment, I'd say it's broken.

--
Ilkka Virta / itvi...@iki.fi

Reply via email to