diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-07-01 17:36:33 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-07-01 17:36:33 +0100 |
commit | 92d78c9799868393977eded0a05148cb1db817bd (patch) | |
tree | 48cf5724901f661993974d7300b4632e8c6db853 | |
parent | cabb46ca81c60638493e7842aeaba9166d5d34a9 (diff) | |
download | rspamd-92d78c9799868393977eded0a05148cb1db817bd.tar.gz rspamd-92d78c9799868393977eded0a05148cb1db817bd.zip |
[Fix] Treat NaN values properly in graph command
-rw-r--r-- | src/controller.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/controller.c b/src/controller.c index 8fb3cb1b1..bee46adce 100644 --- a/src/controller.c +++ b/src/controller.c @@ -1042,7 +1042,8 @@ rspamd_controller_handle_graph ( struct rspamd_controller_worker_ctx *ctx; rspamd_ftok_t srch, *value; struct rspamd_rrd_query_result *rrd_result; - gulong i, j, ts, start_row, cnt, t; + gulong i, j, start_row, cnt, t, ts; + gdouble yval, last = 0; ucl_object_t *res, *elt[4], *data_elt; enum { rra_hourly = 0, @@ -1126,7 +1127,6 @@ rspamd_controller_handle_graph ( for (i = start_row, cnt = 0; cnt < rrd_result->rra_rows; cnt ++) { for (j = 0; j < rrd_result->ds_count; j++) { - gdouble yval; data_elt = ucl_object_typed_new (UCL_OBJECT); t = ts * rrd_result->pdp_per_cdp; @@ -1141,10 +1141,11 @@ rspamd_controller_handle_graph ( ucl_object_fromdouble (yval), "y", 1, false); + last = yval; } else { ucl_object_insert_key (data_elt, - ucl_object_typed_new (UCL_NULL), + ucl_object_fromdouble (last), "y", 1, false); } |