mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-03 21:24:22 +01:00
plugin: Terminate objects with an empty line to signal end
This is just meant as a hint to the plugin that the message is done, and it can try to parse the buffer. Signed-off-by: Christian Decker <@cdecker>
This commit is contained in:
@@ -239,12 +239,14 @@ static void plugin_request_send_(
|
||||
/* Add to map so we can find it later when routing the response */
|
||||
uintmap_add(&plugin->plugins->pending_requests, req->id, req);
|
||||
|
||||
/* Wrap the request in the JSON-RPC request object */
|
||||
/* Wrap the request in the JSON-RPC request object. Terminate
|
||||
* with an empty line that serves as a hint that the JSON
|
||||
* object is done. */
|
||||
out->json = tal_fmt(out, "{"
|
||||
"\"jsonrpc\": \"2.0\", "
|
||||
"\"method\": \"%s\", "
|
||||
"\"params\" : %s, "
|
||||
"\"id\" : %" PRIu64 " }\n",
|
||||
"\"id\" : %" PRIu64 " }\n\n",
|
||||
method, params, request_id);
|
||||
|
||||
/* Queue and notify the writer */
|
||||
|
||||
Reference in New Issue
Block a user