X-Git-Url: https://git.octo.it/?p=collection4.git;a=blobdiff_plain;f=src%2Fmain.c;h=d0e87c1321a50c7cf6d38da1dc440feadc05ec66;hp=2d05baa6495548f13192af8345ac5122ce27e12b;hb=1091c65227a740830654605f0360a0381171301c;hpb=643c2293a8b65f8970e3ef9ea288b20d117592f2 diff --git a/src/main.c b/src/main.c index 2d05baa..d0e87c1 100644 --- a/src/main.c +++ b/src/main.c @@ -37,9 +37,10 @@ #include "utils_cgi.h" #include "action_graph.h" -#include "action_graph_data_json.h" +#include "action_instance_data_json.h" #include "action_graph_def_json.h" #include "action_list_graphs.h" +#include "action_list_graphs_json.h" #include "action_list_hosts.h" #include "action_search.h" #include "action_search_json.h" @@ -64,9 +65,10 @@ static int action_usage (void); static const action_t actions[] = { { "graph", action_graph }, - { "graph_data_json", action_graph_data_json }, + { "instance_data_json", action_instance_data_json }, { "graph_def_json", action_graph_def_json }, { "list_graphs", action_list_graphs }, + { "list_graphs_json", action_list_graphs_json }, { "list_hosts", action_list_hosts }, { "search", action_search }, { "search_json", action_search_json }, @@ -106,7 +108,7 @@ static int handle_request (void) /* {{{ */ action = param ("action"); if (action == NULL) { - return (action_usage ()); + return (action_list_graphs ()); } else { @@ -127,8 +129,9 @@ static int handle_request (void) /* {{{ */ if (i >= actions_num) status = action_usage (); - fflush (stdout); - fclose (stdout); + /* Call finish before updating the graph list, so clients don't wait for + * the update to finish. */ + FCGI_Finish (); gl_update (/* request_served = */ 1);