| 317 | } |
| 318 | |
| 319 | static struct command_result *checkrune_done(struct command *cmd, |
| 320 | const char *method, |
| 321 | const char *buf, |
| 322 | const jsmntok_t *result, |
| 323 | struct cond_info *cinfo) |
| 324 | { |
| 325 | bool valid; |
| 326 | const char *err; |
| 327 | |
| 328 | err = json_scan(cmd, buf, result, "{valid:%}", |
| 329 | JSON_SCAN(json_to_bool, &valid)); |
| 330 | if (err) { |
| 331 | plugin_err(plugin, "Invalid checkrune response (%s) %.*s", |
| 332 | err, |
| 333 | json_tok_full_len(result), |
| 334 | json_tok_full(buf, result)); |
| 335 | } |
| 336 | |
| 337 | /* Shouldn't happen! */ |
| 338 | if (!valid) { |
| 339 | return commando_error(cmd, cinfo->incoming, |
| 340 | COMMANDO_ERROR_REMOTE, |
| 341 | "Invalid rune"); |
| 342 | } |
| 343 | |
| 344 | return execute_command(cmd, cinfo); |
| 345 | } |
| 346 | |
| 347 | static struct command_result *checkrune_failed(struct command *cmd, |
| 348 | const char *method, |
nothing calls this directly
no test coverage detected