diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-11-04 21:47:42 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-11-04 21:47:42 +0000 |
commit | 7342615c7ddd9b99820bd9c03fda2afe7bc868d3 (patch) | |
tree | 4b5ac210a0af55bb3ea1f5d9aebcd91456d397d7 /server-client.c | |
parent | abb728684b00c82460ea439c8df16d3f1018c826 (diff) | |
download | rtmux-7342615c7ddd9b99820bd9c03fda2afe7bc868d3.tar.gz rtmux-7342615c7ddd9b99820bd9c03fda2afe7bc868d3.tar.bz2 rtmux-7342615c7ddd9b99820bd9c03fda2afe7bc868d3.zip |
Switch tty fds over to a bufferevent.
Diffstat (limited to 'server-client.c')
-rw-r--r-- | server-client.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/server-client.c b/server-client.c index 64909d87..f839c305 100644 --- a/server-client.c +++ b/server-client.c @@ -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; |