]> git.ipfire.org Git - thirdparty/bird.git/commit
CLI fix for long-lived sessions during high loads next-cli-buffer
authorMaria Matejka <mq@ucw.cz>
Mon, 11 Jul 2022 11:53:09 +0000 (13:53 +0200)
committerMaria Matejka <mq@ucw.cz>
Thu, 14 Jul 2022 10:09:24 +0000 (12:09 +0200)
commit8691151dbd0194d776e66dcfdc6f4d6e9c1e014c
tree025af85011d939c8538246e3cd06be7dcacfa74d
parentbeb5f78ada79ac90f31f2c4923302c74d9ab38bf
CLI fix for long-lived sessions during high loads

When there is a continuos stream of CLI commands, cli_get_command()
always returns 1 (there is a new command). Anyway, the socket receive
buffer was reset only when there was no command at all, leading to a
strange behavior: after a while, the CLI receive buffer came to its end,
then read() was called with zero size buffer, it returned 0 which was
interpreted as EOF.

Fixing this by:
* resetting the buffer any time CLI RX gets to EOL
* explicitly refusing to pipeline

In future, we may implement CLI pipelining, yet to make it conveniently,
a push-parser may come handy instead of the current implementation.
doc/reply_codes
nest/cli.c
nest/cli.h
sysdep/unix/main.c
test/birdtest.c