| 765 | } |
| 766 | |
| 767 | static struct command_result *command_exec(struct json_connection *jcon, |
| 768 | struct command *cmd, |
| 769 | const char *buffer, |
| 770 | const jsmntok_t *request, |
| 771 | const jsmntok_t *params) |
| 772 | { |
| 773 | struct command_result *res; |
| 774 | |
| 775 | res = cmd->json_cmd->dispatch(cmd, buffer, request, params); |
| 776 | |
| 777 | assert(res == ¶m_failed |
| 778 | || res == &complete |
| 779 | || res == &pending |
| 780 | || res == &unknown); |
| 781 | |
| 782 | /* If they didn't complete it, they must call command_still_pending. |
| 783 | * If they completed it, it's freed already. */ |
| 784 | if (res == &pending) |
| 785 | assert(cmd->pending); |
| 786 | |
| 787 | return res; |
| 788 | } |
| 789 | |
| 790 | /* A plugin hook to take over (fail/alter) RPC commands */ |
| 791 | struct rpc_command_hook_payload { |
no outgoing calls
no test coverage detected