diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-04 05:47:46 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-04 05:47:46 +0000 |
commit | 031be1fc7283bd400ff60b216a38fa734415ca15 (patch) | |
tree | 0e97b56fbcdf71911404a3c2364eb1dd6fc1afdb /server.c | |
parent | 811e75da52a0b504db4221df4504d3594ba3cb8b (diff) | |
download | rtmux-031be1fc7283bd400ff60b216a38fa734415ca15.tar.gz rtmux-031be1fc7283bd400ff60b216a38fa734415ca15.tar.bz2 rtmux-031be1fc7283bd400ff60b216a38fa734415ca15.zip |
Don't crash when looking at NULL clients; also redraw everything on status change.
Diffstat (limited to 'server.c')
-rw-r--r-- | server.c | 19 |
1 files changed, 9 insertions, 10 deletions
@@ -1,4 +1,4 @@ -/* $Id: server.c,v 1.50 2008-06-04 05:40:35 nicm Exp $ */ +/* $Id: server.c,v 1.51 2008-06-04 05:47:46 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -296,16 +296,15 @@ server_handle_clients(struct pollfd **pfd) 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) { + 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); + } + log_debug("testing client %d (%d)", (*pfd)->fd, c->fd); if (buffer_poll(*pfd, c->in, c->out) != 0) { server_lost_client(c); |