From: Vladimír Čunát Date: Thu, 17 Sep 2020 09:14:50 +0000 (+0200) Subject: daemon/io_tty_process_input: add a few comments X-Git-Tag: v5.2.0~28^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65f6039c12d3fa20169fbc1066b5d58c3abf0210;p=thirdparty%2Fknot-resolver.git daemon/io_tty_process_input: add a few comments --- 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) {