MCPcopy Create free account
hub / github.com/axboe/liburing / queue_cancel

Function queue_cancel

examples/proxy.c:821–842  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

819 * for any request we have pending for both in_fd and out_fd.
820 */
821static 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
844static int pending_shutdown(struct conn *c)
845{

Callers 1

handle_stopFunction · 0.85

Calls 3

io_uring_submitFunction · 0.85
get_sqeFunction · 0.70
encode_userdataFunction · 0.70

Tested by

no test coverage detected