| 1156 | } |
| 1157 | |
| 1158 | static int recv_inc(struct conn *c, struct conn_dir *cd, int *bid, |
| 1159 | struct io_uring_cqe *cqe) |
| 1160 | { |
| 1161 | struct conn_buf_ring *cbr = &c->out_br; |
| 1162 | struct conn_buf_ring *in_cbr = &c->in_br; |
| 1163 | void *data; |
| 1164 | |
| 1165 | if (!cqe->res) |
| 1166 | return 0; |
| 1167 | if (cqe->flags & IORING_CQE_F_BUF_MORE) |
| 1168 | return 0; |
| 1169 | |
| 1170 | data = in_cbr->buf + *bid * buf_size; |
| 1171 | if (is_sink) { |
| 1172 | io_uring_buf_ring_add(in_cbr->br, data, buf_size, *bid, br_mask, 0); |
| 1173 | io_uring_buf_ring_advance(in_cbr->br, 1); |
| 1174 | } else if (send_ring) { |
| 1175 | io_uring_buf_ring_add(cbr->br, data, buf_size, *bid, br_mask, 0); |
| 1176 | io_uring_buf_ring_advance(cbr->br, 1); |
| 1177 | } else { |
| 1178 | send_append(c, cd, data, *bid, buf_size); |
| 1179 | } |
| 1180 | *bid = (*bid + 1) & (nr_bufs - 1); |
| 1181 | return 1; |
| 1182 | } |
| 1183 | |
| 1184 | /* |
| 1185 | * Any receive that isn't recvmsg with multishot can be handled the same way. |
no test coverage detected