Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Ilkka Virta Newsgroups: gnu.bash.bug Subject: Re: bash sockets: printf \x0a does TCP fragmentation Date: Sat, 22 Sep 2018 13:30:02 +0300 Lines: 24 Approved: bug-bash@gnu.org Message-ID: References: <20180921231101307758654@bob.proulx.com> <714e1ba0-0052-2f2b-676d-778f2b7129c1@testssl.sh> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1537612219 18832 208.118.235.17 (22 Sep 2018 10:30:19 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash@gnu.org To: dirk+bash@testssl.sh, Bob Proulx Envelope-to: bug-bash@gnu.org User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 In-Reply-To: <714e1ba0-0052-2f2b-676d-778f2b7129c1@testssl.sh> Content-Language: en-US X-SASI-RCODE: 200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; h=subject:to:cc:references:from:message-id:date:mime-version:in-reply-to:content-type:content-transfer-encoding; s=smtp; bh=Y5+vF8nluRLWVT6U7LCqv3w+JD4llo4d+N87fwGdX/o=; b=kYYXgcAy1OVo8AOj4iNtngb1SbtDAfJ4gT8DDqObObzLNzniyD23D97+k2M7pd2Xj2KntN0CyT4Bz4QUnYCgn+SVyNPY1G8YOToIhEYVhofTKD5JkOJIyv7Fnxpw7B8buFJLiiHDTDEbWdq1dKnhhsa9QgO0aR88pnr0No2t8xmwN9Sg5Mru1WIBkSdGZgmT+8LerIydeRKu5WmH/9IA8Mp/QytEj+JEEqhVk4Q07zSYrvY+mVhjrmUfw15azWb8yOxQsw8ALW/AW32uf6Qm4sCSTTcxt6o0S4h20dYUKuQz68Vb/mkLN0OdtydcqNnlYDoddX00whrOx8tr7PcUtA== X-detected-operating-system: by eggs.gnu.org: FreeBSD 8.x X-Received-From: 157.24.2.104 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:14633 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