When tty is error or closed, remove client. Reported by Thomas Sattler.

pull/1050/head
nicm 2017-08-24 08:48:37 +00:00
parent 08b125194e
commit 3c63ad4a9c
1 changed files with 2 additions and 1 deletions

3
tty.c
View File

@ -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);