projects
/
collection4.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
src/graph_list.[ch]: Fix parsing the JSON cache.
[collection4.git]
/
src
/
main.c
diff --git
a/src/main.c
b/src/main.c
index
de252eb
..
74d5d27
100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-38,7
+38,11
@@
#include "action_graph.h"
#include "action_list_graphs.h"
#include "action_graph.h"
#include "action_list_graphs.h"
+#include "action_list_hosts.h"
+#include "action_search.h"
#include "action_search_json.h"
#include "action_search_json.h"
+#include "action_show_graph.h"
+#include "action_show_graph_json.h"
#include "action_show_instance.h"
/* Include this last, so the macro magic of <fcgi_stdio.h> doesn't interfere
#include "action_show_instance.h"
/* Include this last, so the macro magic of <fcgi_stdio.h> doesn't interfere
@@
-59,7
+63,11
@@
static const action_t actions[] =
{
{ "graph", action_graph },
{ "list_graphs", action_list_graphs },
{
{ "graph", action_graph },
{ "list_graphs", action_list_graphs },
+ { "list_hosts", action_list_hosts },
+ { "search", action_search },
{ "search_json", action_search_json },
{ "search_json", action_search_json },
+ { "show_graph", action_show_graph },
+ { "show_graph_json", action_show_graph_json },
{ "show_instance", action_show_instance },
{ "usage", action_usage }
};
{ "show_instance", action_show_instance },
{ "usage", action_usage }
};
@@
-99,14
+107,22
@@
static int handle_request (void) /* {{{ */
else
{
size_t i;
else
{
size_t i;
+ int status = ENOENT;
+
+ gl_update (/* request_served = */ 0);
for (i = 0; i < actions_num; i++)
{
if (strcmp (action, actions[i].name) == 0)
for (i = 0; i < actions_num; i++)
{
if (strcmp (action, actions[i].name) == 0)
-
return ((*actions[i].callback) ()
);
+
status = (*actions[i].callback) (
);
}
}
- return (action_usage ());
+ if (i >= actions_num)
+ status = action_usage ();
+
+ gl_update (/* request_served = */ 1);
+
+ return (status);
}
} /* }}} int handle_request */
}
} /* }}} int handle_request */