diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-05-02 08:34:39 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-05-02 08:34:39 +0000 |
commit | 9164dd63e7f670d3bd6e5132b3d15969aff1d55f (patch) | |
tree | 0cc203c21cd8d93e251f00fd03ed9319eec8b651 /server.c | |
parent | 827fac4c0be130e0410e50a4bd948242c7f9966b (diff) | |
download | rtmux-9164dd63e7f670d3bd6e5132b3d15969aff1d55f.tar.gz rtmux-9164dd63e7f670d3bd6e5132b3d15969aff1d55f.tar.bz2 rtmux-9164dd63e7f670d3bd6e5132b3d15969aff1d55f.zip |
Only worry about complete seconds for status line update. Also reduce poll interval and de-magic-number it.
Diffstat (limited to 'server.c')
-rw-r--r-- | server.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -1,4 +1,4 @@ -/* $Id: server.c,v 1.138 2009-04-30 20:54:53 nicm Exp $ */ +/* $Id: server.c,v 1.139 2009-05-02 08:34:38 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -273,7 +273,7 @@ server_main(int srv_fd) /* Update socket permissions. */ xtimeout = INFTIM; if (sigterm || server_update_socket() != 0) - xtimeout = 100; + xtimeout = POLL_TIMEOUT; /* Do the poll. */ if ((nfds = poll(pfds, nfds, xtimeout)) == -1) { @@ -596,12 +596,12 @@ server_check_timers(struct client *c) if (!options_get_number(&s->options, "status")) return; + /* Check timer; resolution is only a second so don't be too clever. */ interval = options_get_number(&s->options, "status-interval"); if (interval == 0) return; - - tv.tv_sec -= interval; - if (timercmp(&c->status_timer, &tv, <)) + if (tv.tv_sec < c->status_timer.tv_sec || + tv.tv_sec - c->status_timer.tv_sec >= interval) c->flags |= CLIENT_STATUS; } @@ -1009,6 +1009,7 @@ server_second_timers(void) } } + /* Check for a minute having passed. */ gmtime_r(&t, &now); gmtime_r(&last_t, &then); if (now.tm_min == then.tm_min) |