* This connection is going away, queue a cancel for any pending recv, for * example, we have pending for this ring. For completeness, we issue a cancel * for any request we have pending for both in_fd and out_fd. */
| 819 | * for any request we have pending for both in_fd and out_fd. |
| 820 | */ |
| 821 | static void queue_cancel(struct io_uring *ring, struct conn *c) |
| 822 | { |
| 823 | struct io_uring_sqe *sqe; |
| 824 | int flags = 0; |
| 825 | |
| 826 | if (fixed_files) |
| 827 | flags |= IORING_ASYNC_CANCEL_FD_FIXED; |
| 828 | |
| 829 | sqe = get_sqe(ring); |
| 830 | io_uring_prep_cancel_fd(sqe, c->in_fd, flags); |
| 831 | encode_userdata(sqe, c, __CANCEL, 0, c->in_fd); |
| 832 | c->pending_cancels++; |
| 833 | |
| 834 | if (c->out_fd != -1) { |
| 835 | sqe = get_sqe(ring); |
| 836 | io_uring_prep_cancel_fd(sqe, c->out_fd, flags); |
| 837 | encode_userdata(sqe, c, __CANCEL, 0, c->out_fd); |
| 838 | c->pending_cancels++; |
| 839 | } |
| 840 | |
| 841 | io_uring_submit(ring); |
| 842 | } |
| 843 | |
| 844 | static int pending_shutdown(struct conn *c) |
| 845 | { |
no test coverage detected