]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon TTY: don't skip lua_settop in binary mode
authorVladimír Čunát <vladimir.cunat@nic.cz>
Tue, 31 Jan 2017 16:28:54 +0000 (17:28 +0100)
committerŠtěpán Balážik <stepan.balazik@nic.cz>
Fri, 3 Feb 2017 18:29:15 +0000 (19:29 +0100)
This might help if the lua command returns an unexpected number of
arguments.

daemon/main.c

index 8e66348f661b0dbefb19877d4aa63b0f3985eaa8..f3094c36a22eca6e08cc7d2ae0004be579ffab64 100644 (file)
@@ -130,6 +130,7 @@ static void tty_process_input(uv_stream_t *stream, ssize_t nread, const uv_buf_t
                        uint32_t len_n = htonl(len_s);
                        fwrite(&len_n, sizeof(len_n), 1, out);
                        fwrite(message, len_s, 1, out);
+                       lua_settop(L, 0);
                        goto finish;
                }