diff options
author | Ryan Liptak <squeek502@hotmail.com> | 2020-05-06 15:56:57 -0700 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2020-09-02 20:21:07 -0400 |
commit | ea17e1cffb7bb379191c0efd0e264d7bfdafd147 (patch) | |
tree | 7e2f4d335e6520d33c7d504e85edb3cb8d7b8669 /docs/src | |
parent | fa8b4f27c023638918e645ef997c3b56a3a5e681 (diff) | |
download | libuv-ea17e1cffb7bb379191c0efd0e264d7bfdafd147.tar.gz libuv-ea17e1cffb7bb379191c0efd0e264d7bfdafd147.zip |
udp: add UV_UDP_MMSG_FREE recv_cb flag
Refs: https://github.com/libuv/libuv/issues/2822
PR-URL: https://github.com/libuv/libuv/pull/2836
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'docs/src')
-rw-r--r-- | docs/src/udp.rst | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/docs/src/udp.rst b/docs/src/udp.rst index aed7ce22..706d011b 100644 --- a/docs/src/udp.rst +++ b/docs/src/udp.rst @@ -48,6 +48,12 @@ Data types */ UV_UDP_MMSG_CHUNK = 8, /* + * Indicates that the buffer provided has been fully utilized by recvmmsg and + * that it should now be freed by the recv_cb callback. When this flag is set + * in uv_udp_recv_cb, nread will always be 0 and addr will always be NULL. + */ + UV_UDP_MMSG_FREE = 16, + /* * Indicates that recvmmsg should be used, if available. */ UV_UDP_RECVMMSG = 256 @@ -80,8 +86,10 @@ Data types When using :man:`recvmmsg(2)`, chunks will have the `UV_UDP_MMSG_CHUNK` flag set, those must not be freed. There will be a final callback with `nread` set to 0, `addr` set to NULL and the buffer pointing at the initially allocated data with - the `UV_UDP_MMSG_CHUNK` flag cleared. This is a good chance for the callee to - free the provided buffer. + the `UV_UDP_MMSG_CHUNK` flag cleared and the `UV_UDP_MMSG_FREE` flag set. + The callee can now safely free the provided buffer. + + .. versionchanged:: 1.39.0 added the `UV_UDP_MMSG_FREE` flag. .. note:: The receive callback will be called with `nread` == 0 and `addr` == NULL when there is |