=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/server-fn.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- src/usr.bin/tmux/server-fn.c 2009/10/11 10:39:27 1.26 +++ src/usr.bin/tmux/server-fn.c 2009/11/04 23:12:43 1.27 @@ -1,4 +1,4 @@ -/* $OpenBSD: server-fn.c,v 1.26 2009/10/11 10:39:27 nicm Exp $ */ +/* $OpenBSD: server-fn.c,v 1.27 2009/11/04 23:12:43 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -59,6 +59,7 @@ return; log_debug("writing %d to client %d", type, c->ibuf.fd); imsg_compose(ibuf, type, PROTOCOL_VERSION, -1, -1, (void *) buf, len); + server_update_event(c); } void @@ -370,4 +371,19 @@ c->tty.flags &= ~(TTY_FREEZE|TTY_NOCURSOR); server_redraw_client(c); } +} + +void +server_update_event(struct client *c) +{ + short events; + + events = 0; + if (!(c->flags & CLIENT_BAD)) + events |= EV_READ; + if (c->ibuf.w.queued > 0) + events |= EV_WRITE; + event_del(&c->event); + event_set(&c->event, c->ibuf.fd, events, server_client_callback, c); + event_add(&c->event, NULL); }