* Callback for the plugin_manifest request. */
| 1813 | * Callback for the plugin_manifest request. |
| 1814 | */ |
| 1815 | static void plugin_manifest_cb(const char *buffer, |
| 1816 | const jsmntok_t *toks, |
| 1817 | const jsmntok_t *idtok, |
| 1818 | struct plugin *plugin) |
| 1819 | { |
| 1820 | const char *err, *disabled; |
| 1821 | err = plugin_parse_getmanifest_response(buffer, toks, idtok, plugin, &disabled); |
| 1822 | |
| 1823 | if (err) { |
| 1824 | plugin_kill(plugin, LOG_UNUSUAL, "%s", err); |
| 1825 | return; |
| 1826 | } |
| 1827 | |
| 1828 | if (disabled) { |
| 1829 | plugin_kill(plugin, LOG_INFORM, |
| 1830 | "disabled itself: %s", disabled); |
| 1831 | return; |
| 1832 | } |
| 1833 | |
| 1834 | /* Reset timer, it'd kill us otherwise. */ |
| 1835 | plugin->timeout_timer = tal_free(plugin->timeout_timer); |
| 1836 | |
| 1837 | if (!plugin->plugins->startup && !plugin->dynamic) |
| 1838 | plugin_kill(plugin, LOG_INFORM, |
| 1839 | "Not a dynamic plugin"); |
| 1840 | else |
| 1841 | check_plugins_manifests(plugin->plugins, plugin->log); |
| 1842 | } |
| 1843 | |
| 1844 | /* If this is a valid plugin return full path name, otherwise NULL */ |
| 1845 | static const char *plugin_fullpath(const tal_t *ctx, const char *dir, |
nothing calls this directly
no test coverage detected