diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-11-04 21:47:43 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-11-04 21:47:43 +0000 |
commit | 61f1e016a392ec594bd75c723836afda9e8af879 (patch) | |
tree | 9e4a33bd9e94ea82a64f94ea857ccda80f47e47a /usr.bin/tmux/server-client.c | |
parent | 4a10595dee0afa24fc6f3744ea05adc59019ae4e (diff) |
Switch tty fds over to a bufferevent.
Diffstat (limited to 'usr.bin/tmux/server-client.c')
-rw-r--r-- | usr.bin/tmux/server-client.c | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index a2a6b495434..61c85367180 100644 --- a/usr.bin/tmux/server-client.c +++ b/usr.bin/tmux/server-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.12 2009/11/04 20:50:11 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.13 2009/11/04 21:47:42 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -136,8 +136,7 @@ server_client_lost(struct client *c) close(c->ibuf.fd); imsg_clear(&c->ibuf); event_del(&c->event); - event_del(&c->tty.event); - + for (i = 0; i < ARRAY_LENGTH(&dead_clients); i++) { if (ARRAY_ITEM(&dead_clients, i) == NULL) { ARRAY_SET(&dead_clients, i, c); @@ -172,18 +171,6 @@ server_client_prepare(void) event_set(&c->event, c->ibuf.fd, events, server_client_callback, c); event_add(&c->event, NULL); - - if (c->tty.fd == -1) - continue; - if (c->flags & CLIENT_SUSPENDED || c->session == NULL) - continue; - events = EV_READ; - if (BUFFER_USED(c->tty.out) > 0) - events |= EV_WRITE; - event_del(&c->tty.event); - event_set(&c->tty.event, - c->tty.fd, events, server_client_callback, c); - event_add(&c->tty.event, NULL); } } @@ -209,14 +196,6 @@ server_client_callback(int fd, short events, void *data) if (events & EV_READ && server_client_msg_dispatch(c) != 0) goto client_lost; } - - if (c->tty.fd != -1 && fd == c->tty.fd) { - if (c->flags & CLIENT_SUSPENDED || c->session == NULL) - return; - - if (buffer_poll(fd, events, c->tty.in, c->tty.out) != 0) - goto client_lost; - } return; |