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

Function msg_send_next

lightningd/subd.c:672–692  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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