usock: implement usock_inet_timeout() with RFC6555 support
[project/libubox.git] / json_script.c
index 73c2502..7cef481 100644 (file)
@@ -484,8 +484,8 @@ static int cmd_process_strings(struct json_call *call, struct blob_attr *attr)
                        continue;
 
                if (blobmsg_type(cur) != BLOBMSG_TYPE_STRING) {
-                       ctx->handle_error(ctx, "Invalid argument in command", attr);
-                       return -1;
+                       blobmsg_add_blob(&ctx->buf, cur);
+                       continue;
                }
 
                ret = cmd_add_string(call, blobmsg_data(cur));
@@ -541,6 +541,9 @@ static int json_process_cmd(struct json_call *call, struct blob_attr *block)
        }
 
        blobmsg_for_each_attr(cur, block, rem) {
+               if (ctx->abort)
+                       break;
+
                switch(blobmsg_type(cur)) {
                case BLOBMSG_TYPE_STRING:
                        if (!i)
@@ -571,6 +574,8 @@ void json_script_run_file(struct json_script_ctx *ctx, struct json_script_file *
        if (!call.seq)
                call.seq = ++_seq;
 
+       ctx->abort = false;
+
        __json_script_run(&call, file, NULL);
 }