aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2018-04-16 16:26:00 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2018-04-16 16:26:00 +0200
commit3002fb32b0c7fac0b621b3eb7fb83edff0b27e0b (patch)
tree477a62b6c027c6a43fcdf4131c13d6f3efc5fef7
parentd8fcb22daf58a65c1e519d13cff7f372ef0313ed (diff)
downloadjson-rpc-shell-3002fb32b0c7fac0b621b3eb7fb83edff0b27e0b.tar.gz
json-rpc-shell-3002fb32b0c7fac0b621b3eb7fb83edff0b27e0b.tar.xz
json-rpc-shell-3002fb32b0c7fac0b621b3eb7fb83edff0b27e0b.zip
Fix EOF handling with WebSockets
-rw-r--r--json-rpc-shell.c8
1 files changed, 8 insertions, 0 deletions
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