MCPcopy Create free account
hub / github.com/ElementsProject/lightning / msg_send_next

Function msg_send_next

lightningd/subd.c:665–685  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

663}
664
665static struct io_plan *msg_send_next(struct io_conn *conn, struct subd *sd)
666{
667 const u8 *msg;
668 int fd;
669
670 /* Don't send if we haven't read version! */
671 if (!sd->rcvd_version)
672 return msg_queue_wait(conn, sd->outq, msg_send_next, sd);
673
674 /* Nothing to do? Wait for msg_enqueue. */
675 msg = msg_dequeue(sd->outq);
676 if (!msg)
677 return msg_queue_wait(conn, sd->outq, msg_send_next, sd);
678
679 fd = msg_extract_fd(sd->outq, msg);
680 if (fd >= 0) {
681 tal_free(msg);
682 return io_send_fd(conn, fd, true, msg_send_next, sd);
683 }
684 return io_write_wire(conn, take(msg), msg_send_next, sd);
685}
686
687static struct io_plan *msg_setup(struct io_conn *conn, struct subd *sd)
688{

Callers 1

msg_setupFunction · 0.85

Calls 3

msg_dequeueFunction · 0.85
msg_extract_fdFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected