| 932 | } |
| 933 | |
| 934 | static mi_response_t *mi_reset_stats(const mi_params_t *params, |
| 935 | struct mi_handler *async_hdl) |
| 936 | { |
| 937 | mi_item_t *params_arr; |
| 938 | int i, no_params; |
| 939 | str val; |
| 940 | stat_var *stat; |
| 941 | int found = 0; |
| 942 | |
| 943 | if (get_mi_array_param(params, "statistics", ¶ms_arr, &no_params) < 0) |
| 944 | return init_mi_param_error(); |
| 945 | |
| 946 | for (i = 0; i < no_params; i++) { |
| 947 | if (get_mi_arr_param_string(params_arr, i, &val.s, &val.len) < 0) |
| 948 | return init_mi_param_error(); |
| 949 | |
| 950 | stat = get_stat(&val); |
| 951 | if (stat==0) |
| 952 | continue; |
| 953 | |
| 954 | reset_stat( stat ); |
| 955 | found = 1; |
| 956 | } |
| 957 | |
| 958 | if (!found) |
| 959 | return init_mi_error(404, MI_SSTR("Statistics Not Found")); |
| 960 | |
| 961 | return init_mi_result_ok(); |
| 962 | } |
| 963 | |
| 964 | static mi_response_t *mi_reset_all_stats(const mi_params_t *params, |
| 965 | struct mi_handler *async_hdl) |
nothing calls this directly
no test coverage detected