| 1106 | } |
| 1107 | |
| 1108 | struct command_result * |
| 1109 | send_outreq(const struct out_req *req) |
| 1110 | { |
| 1111 | /* The "param" object. */ |
| 1112 | if (req->errcb) |
| 1113 | json_object_end(req->js); |
| 1114 | json_object_end(req->js); |
| 1115 | json_stream_close(req->js, req->cmd); |
| 1116 | |
| 1117 | /* We are about to hand control over to the RPC, so suspend |
| 1118 | * the current span. It'll be resumed as soon as we have a |
| 1119 | * result to pass to either the error or the success |
| 1120 | * callback. */ |
| 1121 | trace_span_start("jsonrpc", req); |
| 1122 | trace_span_tag(req, "id", req->id); |
| 1123 | trace_span_suspend_may_free(req); |
| 1124 | |
| 1125 | ld_rpc_send(req->cmd->plugin, req->js); |
| 1126 | notleak_with_children(req->cmd); |
| 1127 | return &pending; |
| 1128 | } |
| 1129 | |
| 1130 | struct request_batch { |
| 1131 | size_t num_remaining; |