| 380 | }; |
| 381 | |
| 382 | static bool custommsg_cb(struct custommsg_payload *payload, |
| 383 | const char *buffer, const jsmntok_t *toks) |
| 384 | { |
| 385 | const jsmntok_t *t_res; |
| 386 | |
| 387 | if (!toks || !buffer) |
| 388 | return true; |
| 389 | |
| 390 | t_res = json_get_member(buffer, toks, "result"); |
| 391 | |
| 392 | /* fail */ |
| 393 | if (!t_res || !json_tok_streq(buffer, t_res, "continue")) |
| 394 | fatal("Plugin returned an invalid response to the " |
| 395 | "custommsg hook: %s", buffer); |
| 396 | |
| 397 | /* call next hook */ |
| 398 | return true; |
| 399 | } |
| 400 | |
| 401 | static void custommsg_final(struct custommsg_payload *payload STEALS) |
| 402 | { |
nothing calls this directly
no test coverage detected