Browse Source

jsonrpc: helper to move an existing io_write.

It's a very ugly one-liner; really ccan/io should have an io_replan
for this, but it would have to be written carefully as it makes
assumptions currently about plans not changing.  In this case, we know
it's in io_write, and we're just moving a pointer.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.2rc1
Rusty Russell 6 years ago
parent
commit
f4a2c4f8bb
  1. 7
      lightningd/jsonrpc.c

7
lightningd/jsonrpc.c

@ -6,6 +6,7 @@
#include <bitcoin/script.h>
#include <ccan/array_size/array_size.h>
#include <ccan/err/err.h>
#include <ccan/io/backend.h>
#include <ccan/io/io.h>
#include <ccan/str/hex/hex.h>
#include <ccan/tal/str/str.h>
@ -53,6 +54,12 @@ static void destroy_jcon(struct json_connection *jcon)
tal_free(jcon->log);
}
/* FIXME: This, or something prettier (io_replan?) belong in ccan/io! */
static UNNEEDED void adjust_io_write(struct io_conn *conn, ptrdiff_t delta)
{
conn->plan[IO_OUT].arg.u1.cp += delta;
}
static void json_help(struct command *cmd,
const char *buffer, const jsmntok_t *params);

Loading…
Cancel
Save