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