diff options
Diffstat (limited to 'server-client.c')
-rw-r--r-- | server-client.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/server-client.c b/server-client.c index e225de30..6d5d0833 100644 --- a/server-client.c +++ b/server-client.c @@ -223,7 +223,7 @@ server_client_callback(int fd, short events, void *data) return; if (fd == c->ibuf.fd) { - if (events & EV_WRITE && msgbuf_write(&c->ibuf.w) < 0 && + if (events & EV_WRITE && msgbuf_write(&c->ibuf.w) <= 0 && errno != EAGAIN) goto client_lost; @@ -656,7 +656,7 @@ server_client_reset_state(struct client *c) */ mode = s->mode; if ((c->tty.mouse.flags & MOUSE_RESIZE_PANE) && - !(mode & (MODE_MOUSE_BUTTON|MODE_MOUSE_ANY))) + !(mode & MODE_MOUSE_BUTTON)) mode |= MODE_MOUSE_BUTTON; /* @@ -884,6 +884,9 @@ server_client_msg_dispatch(struct client *c) break; c->flags &= ~CLIENT_SUSPENDED; + if (c->tty.fd == -1) /* exited in the meantime */ + break; + if (gettimeofday(&c->activity_time, NULL) != 0) fatal("gettimeofday"); if (c->session != NULL) |