* Queue a send based on the data received in this cqe, which came from * a completed receive operation. */
| 1124 | * a completed receive operation. |
| 1125 | */ |
| 1126 | static void send_append(struct conn *c, struct conn_dir *cd, void *data, |
| 1127 | int bid, int len) |
| 1128 | { |
| 1129 | vlog("%d: send %d (%p, bid %d)\n", c->tid, len, data, bid); |
| 1130 | |
| 1131 | assert(bid < nr_bufs); |
| 1132 | |
| 1133 | /* if using provided buffers for send, add it upfront */ |
| 1134 | if (send_ring) { |
| 1135 | struct conn_buf_ring *cbr = &c->out_br; |
| 1136 | |
| 1137 | io_uring_buf_ring_add(cbr->br, data, len, bid, br_mask, 0); |
| 1138 | io_uring_buf_ring_advance(cbr->br, 1); |
| 1139 | } else { |
| 1140 | send_append_vec(cd, data, len); |
| 1141 | } |
| 1142 | } |
| 1143 | |
| 1144 | /* |
| 1145 | * For non recvmsg && multishot, a zero receive marks the end. For recvmsg |
no test coverage detected