From 3002fb32b0c7fac0b621b3eb7fb83edff0b27e0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Janouch?= Date: Mon, 16 Apr 2018 16:26:00 +0200 Subject: Fix EOF handling with WebSockets --- json-rpc-shell.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'json-rpc-shell.c') diff --git a/json-rpc-shell.c b/json-rpc-shell.c index 96ac55a..076e53f 100644 --- a/json-rpc-shell.c +++ b/json-rpc-shell.c @@ -3238,9 +3238,17 @@ on_tty_readable (EV_P_ ev_io *handle, int revents) { (void) handle; + static bool readline_reentrancy_lock; + if (readline_reentrancy_lock) + return; + struct app_context *ctx = ev_userdata (loop); if (revents & EV_READ) + { + readline_reentrancy_lock = true; ctx->input->vtable->on_tty_readable (ctx->input); + readline_reentrancy_lock = false; + } } static void -- cgit v1.2.3