summaryrefslogtreecommitdiffstats
path: root/tty.c
diff options
context:
space:
mode:
authornicm <nicm>2017-08-24 08:48:37 +0000
committernicm <nicm>2017-08-24 08:48:37 +0000
commit3c63ad4a9c431e5dc96d535cb7118781910a372b (patch)
tree6055ef2be0f8e8615146eb48d509da8f8e31b1e3 /tty.c
parent08b125194ee37b9f2c597b6a39376c47dd74433b (diff)
When tty is error or closed, remove client. Reported by Thomas Sattler.
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tty.c b/tty.c
index 24c5d83e..0d1aa368 100644
--- a/tty.c
+++ b/tty.c
@@ -159,8 +159,9 @@ tty_read_callback(__unused int fd, __unused short events, void *data)
int nread;
nread = evbuffer_read(tty->in, tty->fd, -1);
- if (nread == -1) {
+ if (nread == 0 || nread == -1) {
event_del(&tty->event_in);
+ server_client_lost(tty->client);
return;
}
log_debug("%s: read %d bytes (already %zu)", c->name, nread, size);