* Callback for the plugin_manifest request. */
| 1549 | * Callback for the plugin_manifest request. |
| 1550 | */ |
| 1551 | static void plugin_manifest_cb(const char *buffer, |
| 1552 | const jsmntok_t *toks, |
| 1553 | const jsmntok_t *idtok, |
| 1554 | struct plugin *plugin) |
| 1555 | { |
| 1556 | const char *err, *disabled; |
| 1557 | err = plugin_parse_getmanifest_response(buffer, toks, idtok, plugin, &disabled); |
| 1558 | |
| 1559 | if (err) { |
| 1560 | plugin_kill(plugin, LOG_UNUSUAL, "%s", err); |
| 1561 | return; |
| 1562 | } |
| 1563 | |
| 1564 | if (disabled) { |
| 1565 | plugin_kill(plugin, LOG_DBG, |
| 1566 | "disabled itself: %s", disabled); |
| 1567 | return; |
| 1568 | } |
| 1569 | |
| 1570 | /* Reset timer, it'd kill us otherwise. */ |
| 1571 | plugin->timeout_timer = tal_free(plugin->timeout_timer); |
| 1572 | |
| 1573 | if (!plugin->plugins->startup && !plugin->dynamic) |
| 1574 | plugin_kill(plugin, LOG_INFORM, |
| 1575 | "Not a dynamic plugin"); |
| 1576 | else |
| 1577 | check_plugins_manifests(plugin->plugins); |
| 1578 | } |
| 1579 | |
| 1580 | /* If this is a valid plugin return full path name, otherwise NULL */ |
| 1581 | static const char *plugin_fullpath(const tal_t *ctx, const char *dir, |
nothing calls this directly
no test coverage detected