Skip to content

Commit

Permalink
fixup! plugin: Split the parsing from the request handling in the plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
cdecker committed Dec 11, 2018
1 parent d6afd1f commit 99e40e2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lightningd/plugin.c
Expand Up @@ -431,10 +431,12 @@ static struct io_plan *plugin_read_json(struct io_conn *conn UNUSED,
/* Read and process all messages from the connection */
do {
success = plugin_read_json_one(plugin);
} while (success && ! plugin->stop);

if (plugin->stop)
return io_close(plugin->stdout_conn);
/* Processing the message from the plugin might have
* resulted in it stopping, so let's check. */
if (plugin->stop)
return io_close(plugin->stdout_conn);
} while (success);

/* Now read more from the connection */
return io_read_partial(plugin->stdout_conn,
Expand Down

0 comments on commit 99e40e2

Please sign in to comment.