aboutsummaryrefslogtreecommitdiffstats
path: root/src/controller.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-07-01 17:36:55 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-07-01 17:36:55 +0100
commit530d64a5a04a6becd0254c58124a5521c538c77e (patch)
tree6cc20dc90c41f1fdae62acada293bc47b4ba154a /src/controller.c
parent92d78c9799868393977eded0a05148cb1db817bd (diff)
downloadrspamd-530d64a5a04a6becd0254c58124a5521c538c77e.tar.gz
rspamd-530d64a5a04a6becd0254c58124a5521c538c77e.zip
[Fix] Correctly parse query type
Diffstat (limited to 'src/controller.c')
-rw-r--r--src/controller.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/controller.c b/src/controller.c
index bee46adce..78c168460 100644
--- a/src/controller.c
+++ b/src/controller.c
@@ -1081,16 +1081,16 @@ rspamd_controller_handle_graph (
return 0;
}
- if (strncmp (value->begin, "hourly", value->len) == 0) {
+ if (value->len == 6 && rspamd_lc_cmp (value->begin, "hourly", value->len) == 0) {
rra_num = rra_hourly;
}
- else if (strncmp (value->begin, "daily", value->len) == 0) {
- rra_num = rra_hourly;
+ else if (value->len == 5 && rspamd_lc_cmp (value->begin, "daily", value->len) == 0) {
+ rra_num = rra_daily;
}
- else if (strncmp (value->begin, "weekly", value->len) == 0) {
- rra_num = rra_hourly;
+ else if (value->len == 6 && rspamd_lc_cmp (value->begin, "weekly", value->len) == 0) {
+ rra_num = rra_weekly;
}
- else if (strncmp (value->begin, "monthly", value->len) == 0) {
+ else if (value->len == 7 && rspamd_lc_cmp (value->begin, "monthly", value->len) == 0) {
rra_num = rra_monthly;
}