JSON RPC: In the shutdown loop, ignore plugin responses to JSON RPC requests

This commit is contained in:
Simon Vrouwe 2021-11-10 11:08:14 +02:00 committed by Rusty Russell
parent ef503f2fea
commit 209614677a
1 changed files with 5 additions and 0 deletions

View File

@ -520,6 +520,11 @@ static const char *plugin_response_handle(struct plugin *plugin,
"Received a JSON-RPC response for non-existent request"); "Received a JSON-RPC response for non-existent request");
} }
/* Ignore responses when shutting down */
if (plugin->plugins->ld->state == LD_STATE_SHUTDOWN) {
return NULL;
}
/* We expect the request->cb to copy if needed */ /* We expect the request->cb to copy if needed */
pd = plugin_detect_destruction(plugin); pd = plugin_detect_destruction(plugin);
request->response_cb(plugin->buffer, toks, idtok, request->response_cb_arg); request->response_cb(plugin->buffer, toks, idtok, request->response_cb_arg);