Fix client to log long input lines untruncated
They can still get split by output arriving between two reads from input, but that's unavoidable, because the client is designed to read and write big chunks, not lines.
This commit is contained in:
parent
819e28421e
commit
e8b98f308e
1 changed files with 2 additions and 2 deletions
|
@ -432,11 +432,11 @@ recv_input(int fd, struct ring *inbuf)
|
||||||
assert(ch != EOF);
|
assert(ch != EOF);
|
||||||
if (ch != '\r' && lbuf_putc(&cmdbuf, ch) > 0) {
|
if (ch != '\r' && lbuf_putc(&cmdbuf, ch) > 0) {
|
||||||
line = lbuf_line(&cmdbuf);
|
line = lbuf_line(&cmdbuf);
|
||||||
if (auxfp)
|
|
||||||
fputs(line, auxfp);
|
|
||||||
save_input(line);
|
save_input(line);
|
||||||
lbuf_init(&cmdbuf);
|
lbuf_init(&cmdbuf);
|
||||||
}
|
}
|
||||||
|
if (auxfp)
|
||||||
|
putc(ch, auxfp);
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue