From 65f6039c12d3fa20169fbc1066b5d58c3abf0210 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Thu, 17 Sep 2020 11:14:50 +0200 Subject: [PATCH] daemon/io_tty_process_input: add a few comments --- daemon/io.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/daemon/io.c b/daemon/io.c index 1e5513471..8c929ecf2 100644 --- a/daemon/io.c +++ b/daemon/io.c @@ -445,8 +445,8 @@ enum io_stream_mode { struct io_stream_data { enum io_stream_mode mode; - size_t blen; - char *buf; + size_t blen; ///< length of `buf` + char *buf; ///< growing buffer residing on `pool` (mp_append_*) knot_mm_t *pool; }; @@ -481,6 +481,7 @@ void io_tty_process_input(uv_stream_t *stream, ssize_t nread, const uv_buf_t *bu } } + /** The current single command and the remaining command(s). */ char *cmd, *cmd_next = NULL; bool incomplete_cmd = false; @@ -511,6 +512,7 @@ void io_tty_process_input(uv_stream_t *stream, ssize_t nread, const uv_buf_t *bu cmd_next = strtok(NULL, "\n"); } + /** Moving pointer to end of buffer with incomplete command. */ char *pbuf = data->buf + data->blen; lua_State *L = the_worker->engine->L; while (cmd != NULL) { -- 2.47.3