Re: Pty is losing bytes

Linus Torvalds
2005-02-16T16:06:25Z

On Wed, 16 Feb 2005, Theodore Ts'o wrote:
>
> The comment above the test explains why that test is there in
> n_tty_receive_room. If that test isn't there, and we are doing input
> canonicalization, when the buffer gets full

Yes, yes, but did you see my suggested version that I had just below that
explained what I thought the real fix was?

Th eproblem with checking for the "canon but no canon data" is that it's a
special case that IS ONLY VALID WHEN THE BUFFER IS FULL! Until that
happens, it means that the code returns the wrong value, and then can
(obviously, as seen by the bug) drop bytes even when it shouldn't.

That's why my suggested work-around moved things around, to only return
the "we'll take anything" thing if the buffer really was full.

Linus