Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14633 > unrolled thread

Re: bash sockets: printf \x0a does TCP fragmentation

Started byIlkka Virta <itvirta@iki.fi>
First post2018-09-22 13:30 +0300
Last post2018-09-22 13:30 +0300
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: bash sockets: printf \x0a does TCP fragmentation Ilkka Virta <itvirta@iki.fi> - 2018-09-22 13:30 +0300

#14633 — Re: bash sockets: printf \x0a does TCP fragmentation

FromIlkka Virta <itvirta@iki.fi>
Date2018-09-22 13:30 +0300
SubjectRe: bash sockets: printf \x0a does TCP fragmentation
Message-ID<mailman.1132.1537612219.1284.bug-bash@gnu.org>
On 22.9. 12:50, dirk+bash@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 / itvirta@iki.fi

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web