Skip to content

Commit

Permalink
fixup! json: Only start parsing once we're sure we have a message
Browse files Browse the repository at this point in the history
  • Loading branch information
cdecker committed Aug 27, 2020
1 parent 0e4c6b6 commit 1634f45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lightningd/plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ static struct io_plan *plugin_read_json(struct io_conn *conn,
* overlap if we're not at the start) to see if we have a '\n\n'
* separator. If not we can skip the JSON attempt. */
have_full = memmem(plugin->buffer + plugin->used - offset,
plugin->len_read + offset, "\n\n", 2);
plugin->len_read + offset, "}\n", 2);

plugin->used += plugin->len_read;
if (plugin->used == tal_count(plugin->buffer))
Expand Down

0 comments on commit 1634f45

Please sign in to comment.