From 723f1103083237bc9584797231f32d877f9a5d4d Mon Sep 17 00:00:00 2001 From: Roberto Hueso Gómez Date: Mon, 28 Oct 2019 10:32:02 +0100 Subject: #915 Use og_cmd_legacy_send in og_cmd_run_schedule for ogAdmServer This patch simplifies the og_cmd_run_schedule function by calling og_cmd_legacy_send. --- sources/ogAdmServer.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/sources/ogAdmServer.cpp b/sources/ogAdmServer.cpp index c75acf1..025bfcd 100644 --- a/sources/ogAdmServer.cpp +++ b/sources/ogAdmServer.cpp @@ -4084,11 +4084,9 @@ static int og_cmd_setup_image(json_t *element, struct og_msg_params *params) static int og_cmd_run_schedule(json_t *element, struct og_msg_params *params) { - char buf[4096] = {}; - int err = 0, len; const char *key; json_t *value; - TRAMA *msg; + int err = 0; json_object_foreach(element, key, value) { if (!strcmp(key, "clients")) @@ -4098,16 +4096,7 @@ static int og_cmd_run_schedule(json_t *element, struct og_msg_params *params) break; } - len = snprintf(buf, sizeof(buf), "nfn=EjecutaComandosPendientes"); - - msg = og_msg_alloc(buf, len); - if (!msg) - return -1; - - og_send_cmd((char **)params->ips_array, params->ips_array_len, - CLIENTE_OCUPADO, msg); - - og_msg_free(msg); + og_cmd_legacy_send(params, "EjecutaComandosPendientes", CLIENTE_OCUPADO); return 0; } -- cgit v1.2.3-18-g5258