aboutsummaryrefslogtreecommitdiff
path: root/src/output.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-04-29 18:11:56 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2009-04-29 18:11:56 +0300
commit5a1f674eecba607ffa328484ca34c598690ff8d2 (patch)
tree5dcda78e8352461d2ee7fdc29c64a265024cb219 /src/output.c
parent20d7f1d7e051c6b021a3f5d088985a74c3370b29 (diff)
downloadtagr-5a1f674eecba607ffa328484ca34c598690ff8d2.tar.gz
tagr-5a1f674eecba607ffa328484ca34c598690ff8d2.tar.bz2
Fix locking issues. Improve stream interface.
* gnulib.modules: Add c-type, c-strcase, crypto/md5, xgetdomainname, xgethostname. * src/Makefile.am (tagr_SOURCES): Add apop.c, udb.c, xhostname.c * src/graph.c (draw_graph): Rename `now' to `start'. * src/main.c (hostname, rebuild_last_option): New globals. (main): Init hostname. * src/output.c (update_output): Change semantics of the last parameter. * src/readconfig.c (cb_facility): Use c_strcasecmp. (tagr_kw): New keywords: hostname, udb-file, lock-count, lock-timeout, idle-timeout. * src/report.c: Fix locking issues. (update_monitor): Change semantics of the last parameter. (rebuild): Likewise. * src/server.c: Rewrite stream interface. * src/tagr.h (TAGR_ARG_UNUSED, TAGR_PRINTFLIKE): New macros. (lock_retry_count_option, lock_retry_timeout_option) (stream_idle_timeout, hostname): New declarations. (TAGR_UPD_FORCE, TAGR_UPD_LASTTIME): New defines. (trim_crlf, tagr_local_hostnamem tagr_auth_init, tagr_auth) (tagr_udb_name) (udb_get_passwordudb_free_password): New declarations. * TODO: Update
Diffstat (limited to 'src/output.c')
-rw-r--r--src/output.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/output.c b/src/output.c
index 4b6e206..e2e8b92 100644
--- a/src/output.c
+++ b/src/output.c
@@ -177,7 +177,8 @@ do_update_output (struct monitor *mon, struct image_descr *dscr,
else
{
rc = draw_graph (fp, mon, queue, avg, timestamp, dscr->step,
- dscr->step*460 /* FIXME: must be queue->size * step */,
+ dscr->step*460
+ /*^ FIXME: must be queue->size * step */,
0, dscr->xgrid, dscr->ygrid);
fclose (fp);
}
@@ -236,7 +237,7 @@ format_timestamp (FILE *fp, union value v, const char *fmt, int prec)
int
update_output (struct monitor *mon, struct traffic_record *tr,
- time_t timestamp, int force_update)
+ time_t timestamp, int flags)
{
char *dirname = mkfilename (basedir, mon->dir, NULL);
int rc;
@@ -245,6 +246,7 @@ update_output (struct monitor *mon, struct traffic_record *tr,
char *tabfile = mkfilename (dirname, mon->name, ".tab");
char *htmlname;
pp_value_t *p;
+ int force_update = flags & TAGR_UPD_FORCE;
if (!force_update)
{
@@ -252,6 +254,9 @@ update_output (struct monitor *mon, struct traffic_record *tr,
force_update = 1;
}
+ if (flags & TAGR_UPD_LASTTIME)
+ timestamp = tr->last.time;
+
rc = do_update_output (mon, &img_day,
&tr->day_hist, NULL, &tab,
timestamp, dirname, 1);

Return to:

Send suggestions and report system problems to the System administrator.