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