Signed-off-by: Felix Fietkau <nbd@openwrt.org>
}
blobmsg_for_each_attr(cur, block, rem) {
+ if (ctx->abort)
+ break;
+
switch(blobmsg_type(cur)) {
case BLOBMSG_TYPE_STRING:
if (!i)
if (!call.seq)
call.seq = ++_seq;
+ ctx->abort = false;
+
__json_script_run(&call, file, NULL);
}
struct blob_buf buf;
uint32_t run_seq;
+ bool abort;
/*
* handle_command: handle a command that was not recognized by the
void json_script_run_file(struct json_script_ctx *ctx, struct json_script_file *file,
struct blob_attr *vars);
+
+/*
+ * json_script_abort - abort current json script run
+ *
+ * to be called from a script context callback
+ */
+static inline void
+json_script_abort(struct json_script_ctx *ctx)
+{
+ ctx->abort = true;
+}
+
/*
* json_script_eval_string - evaluate a string and store the result
*