From: Yeonggi Kim <[email protected]>

Hi,

Since 20ec1de214 (3.2-dev12), a CLI command line of exactly tune.bufsize
bytes, including its final LF, is executed and then followed by endless
"Unknown command" errors. b_tail() wraps when the line fills its chunk,
so the last command is never detected. 40cca6d20 ("Don't read a command
or payload line into a full buffer") covers the payload side of the same
full-chunk case.

  - 1/2 computes the end of the line from the head of the chunk and its
    amount of data instead, and has a one-line reproducer.
  - 2/2 adds reg-tests/cli/cmdline_full_buffer.vtc.

The test fails without 1/2 and passes with it on master 313dae2, 3.4.6,
3.3.16 and 3.2.25. Passing b_getdelim() one byte less than the room
again, as before 20ec1de214, would avoid the loop but reject these
lines, accepted since 3.2, as too big.

Both should be backported as far as 3.2.

Thanks,
Yeonggi Kim

Yeonggi Kim (2):
  BUG/MEDIUM: cli: fix the last command detection on a full command line
  REGTESTS: cli: test a command line of exactly tune.bufsize bytes

 reg-tests/cli/cmdline_full_buffer.vtc | 53 +++++++++++++++++++++++++++
 src/cli.c                             |  8 +++-
 2 files changed, 60 insertions(+), 1 deletion(-)
 create mode 100644 reg-tests/cli/cmdline_full_buffer.vtc

-- 
2.52.0



Reply via email to