summaryrefslogtreecommitdiffstats
path: root/sources/ogAdmServer.cpp
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2019-10-28 10:32:02 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2019-10-29 14:22:08 +0100
commit723f1103083237bc9584797231f32d877f9a5d4d (patch)
tree0c06824339bbd50e6ac1098b955b251005ff1430 /sources/ogAdmServer.cpp
parent2f7e9da5ab8b47ec66820b58a556b3fd8c0a8856 (diff)
#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.
Diffstat (limited to 'sources/ogAdmServer.cpp')
-rw-r--r--sources/ogAdmServer.cpp15
1 files 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;
}