| 1979 | |
| 1980 | } |
| 1981 | const char *plugin_send_getmanifest(struct plugin *p, const char *cmd_id) |
| 1982 | { |
| 1983 | char **cmd; |
| 1984 | int stdinfd, stdoutfd; |
| 1985 | struct jsonrpc_request *req; |
| 1986 | |
| 1987 | cmd = tal_arr(tmpctx, char *, 1); |
| 1988 | cmd[0] = p->cmd; |
| 1989 | if (debugging(p)) |
| 1990 | tal_arr_expand(&cmd, "--dev-debug-self"); |
| 1991 | if (p->plugins->ld->developer) |
| 1992 | tal_arr_expand(&cmd, "--developer"); |
| 1993 | tal_arr_expand(&cmd, NULL); |
| 1994 | p->pid = pipecmdarr(&stdinfd, &stdoutfd, &pipecmd_preserve, cmd); |
| 1995 | if (p->pid == -1) |
| 1996 | return tal_fmt(p, "opening pipe: %s", strerror(errno)); |
| 1997 | |
| 1998 | log_debug(p->plugins->log, "started(%u) %s", p->pid, p->cmd); |
| 1999 | p->json_in = jsonrpc_io_new(p); |
| 2000 | |
| 2001 | /* Create two connections, one read-only on top of p->stdout, and one |
| 2002 | * write-only on p->stdin */ |
| 2003 | io_new_conn(p, stdoutfd, plugin_stdout_conn_init, p); |
| 2004 | io_new_conn(p, stdinfd, plugin_stdin_conn_init, p); |
| 2005 | req = jsonrpc_request_start(p, "getmanifest", cmd_id, |
| 2006 | p->log, NULL, plugin_manifest_cb, p); |
| 2007 | json_add_bool(req->stream, "allow-deprecated-apis", |
| 2008 | p->plugins->ld->deprecated_ok); |
| 2009 | jsonrpc_request_end(req); |
| 2010 | plugin_request_send(p, req); |
| 2011 | p->plugin_state = AWAITING_GETMANIFEST_RESPONSE; |
| 2012 | |
| 2013 | plugin_set_timeout(p); |
| 2014 | return NULL; |
| 2015 | } |
| 2016 | |
| 2017 | bool plugins_send_getmanifest(struct plugins *plugins, const char *cmd_id) |
| 2018 | { |
no test coverage detected