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

Function handle_send_inc

examples/proxy.c:1518–1543  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1516}
1517
1518static int handle_send_inc(struct conn *c, struct conn_dir *cd, int bid,
1519 struct io_uring_cqe *cqe)
1520{
1521 struct conn_buf_ring *in_cbr = &c->in_br;
1522 int ret = 0;
1523 void *data;
1524
1525 if (!cqe->res)
1526 goto out;
1527 if (cqe->flags & IORING_CQE_F_BUF_MORE)
1528 return 0;
1529
1530 assert(cqe->res <= buf_size);
1531 cd->out_bytes += cqe->res;
1532
1533 data = in_cbr->buf + bid * buf_size;
1534 io_uring_buf_ring_add(in_cbr->br, data, buf_size, bid, br_mask, 0);
1535 io_uring_buf_ring_advance(in_cbr->br, 1);
1536 bid = (bid + 1) & (nr_bufs - 1);
1537 ret = 1;
1538out:
1539 if (pending_shutdown(c))
1540 close_cd(c, cd);
1541
1542 return ret;
1543}
1544
1545/*
1546 * Handling a send with an outgoing send ring. Get the buffers from the

Callers 1

__handle_sendFunction · 0.85

Calls 2

pending_shutdownFunction · 0.85
close_cdFunction · 0.85

Tested by

no test coverage detected