diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-04 05:40:35 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-04 05:40:35 +0000 |
commit | 811e75da52a0b504db4221df4504d3594ba3cb8b (patch) | |
tree | c68e6c59f4d3814fea41e6dae6bfb795c98ee7a7 /server.c | |
parent | 9e6090a7a2a0d25499bce0dc68fd67289f3a5e39 (diff) |
Status bar left and right strings (set with status-left and status-right), and automatic update (at interval set by status-interval).
Diffstat (limited to 'server.c')
-rw-r--r-- | server.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $Id: server.c,v 1.49 2008-06-03 21:42:37 nicm Exp $ */ +/* $Id: server.c,v 1.50 2008-06-04 05:40:35 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -163,7 +163,7 @@ server_main(const char *srv_path, int srv_fd) /* Do the poll. */ log_debug("polling %d fds", nfds); - if ((nfds = poll(pfds, nfds, INFTIM)) == -1) { + if ((nfds = poll(pfds, nfds, 500)) == -1) { if (errno == EAGAIN || errno == EINTR) continue; fatal("poll failed"); @@ -290,11 +290,21 @@ void server_handle_clients(struct pollfd **pfd) { struct client *c; + struct timespec now; u_int i; for (i = 0; i < ARRAY_LENGTH(&clients); i++) { c = ARRAY_ITEM(&clients, i); + /* XXX REDRAW FLAGS */ + if (c->session != NULL && options_get_number( + &c->session->options, "status-lines") != 0) { + if (clock_gettime(CLOCK_REALTIME, &now) != 0) + fatal("clock_gettime"); + if (timespeccmp(&now, &c->status_ts, >)) + server_status_client(c); + } + if (c != NULL) { log_debug("testing client %d (%d)", (*pfd)->fd, c->fd); if (buffer_poll(*pfd, c->in, c->out) != 0) { |