Skip to content

Commit afe7f41

Browse files
cjihrigBridgeAR
authored andcommitted
deps: upgrade to libuv 1.37.0
Notable changes: - The UV_UDP_RECVMMSG flag has been added. This flag is now required in order to utilize recvmmsg(). This was added in response to a regression introduced in 1.35.0 and 1.36.0. PR-URL: #32866 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
1 parent 771ca7d commit afe7f41

File tree

9 files changed

+48
-21
lines changed

9 files changed

+48
-21
lines changed

deps/uv/AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -424,3 +424,4 @@ Lin Zhang <linroid@gmail.com>
424424
Sk Sajidul Kadir <sheikh.sajid522@gmail.com>
425425
twosee <twose@qq.com>
426426
Rikard Falkeborn <rikard.falkeborn@gmail.com>
427+
Yash Ladha <yashladhapankajladha123@gmail.com>

deps/uv/ChangeLog

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2020.04.20, Version 1.37.0 (Stable), 02a9e1be252b623ee032a3137c0b0c94afbe6809
2+
3+
Changes since version 1.36.0:
4+
5+
* timer: remove redundant check in heap compare (Yash Ladha)
6+
7+
* udp: add flag to enable recvmmsg(2) explicitly (Saúl Ibarra Corretgé)
8+
9+
110
2020.04.16, Version 1.36.0 (Stable), 533b738838ad8407032e14b6772b29ef9af63cfa
211

312
Changes since version 1.35.0:

deps/uv/configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1414

1515
AC_PREREQ(2.57)
16-
AC_INIT([libuv], [1.36.0], [https://github.com/libuv/libuv/issues])
16+
AC_INIT([libuv], [1.37.0], [https://github.com/libuv/libuv/issues])
1717
AC_CONFIG_MACRO_DIR([m4])
1818
m4_include([m4/libuv-extra-automake-flags.m4])
1919
m4_include([m4/as_case.m4])

deps/uv/docs/src/udp.rst

+18-6
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,16 @@ Data types
4141
* (provided they all set the flag) but only the last one to bind will receive
4242
* any traffic, in effect "stealing" the port from the previous listener.
4343
*/
44-
UV_UDP_REUSEADDR = 4
44+
UV_UDP_REUSEADDR = 4,
4545
/*
4646
* Indicates that the message was received by recvmmsg, so the buffer provided
4747
* must not be freed by the recv_cb callback.
4848
*/
49-
UV_UDP_MMSG_CHUNK = 8
49+
UV_UDP_MMSG_CHUNK = 8,
50+
/*
51+
* Indicates that recvmmsg should be used, if available.
52+
*/
53+
UV_UDP_RECVMMSG = 256
5054
};
5155

5256
.. c:type:: void (*uv_udp_send_cb)(uv_udp_send_t* req, int status)
@@ -125,12 +129,17 @@ API
125129
126130
.. c:function:: int uv_udp_init_ex(uv_loop_t* loop, uv_udp_t* handle, unsigned int flags)
127131
128-
Initialize the handle with the specified flags. At the moment the lower 8 bits
129-
of the `flags` parameter are used as the socket domain. A socket will be created
130-
for the given domain. If the specified domain is ``AF_UNSPEC`` no socket is created,
131-
just like :c:func:`uv_udp_init`.
132+
Initialize the handle with the specified flags. The lower 8 bits of the `flags`
133+
parameter are used as the socket domain. A socket will be created for the given domain.
134+
If the specified domain is ``AF_UNSPEC`` no socket is created, just like :c:func:`uv_udp_init`.
135+
136+
The remaining bits can be used to set one of these flags:
137+
138+
* `UV_UDP_RECVMMSG`: if set, and the platform supports it, :man:`recvmmsg(2)` will
139+
be used.
132140
133141
.. versionadded:: 1.7.0
142+
.. versionchanged:: 1.37.0 added the `UV_UDP_RECVMMSG` flag.
134143
135144
.. c:function:: int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock)
136145
@@ -379,6 +388,9 @@ API
379388
.. versionchanged:: 1.35.0 added support for :man:`recvmmsg(2)` on supported platforms).
380389
The use of this feature requires a buffer larger than
381390
2 * 64KB to be passed to `alloc_cb`.
391+
.. versionchanged:: 1.37.0 :man:`recvmmsg(2)` support is no longer enabled implicitly,
392+
it must be explicitly requested by passing the `UV_UDP_RECVMMSG` flag to
393+
:c:func:`uv_udp_init_ex`.
382394
383395
.. c:function:: int uv_udp_recv_stop(uv_udp_t* handle)
384396

deps/uv/include/uv.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,12 @@ enum uv_udp_flags {
610610
* Indicates that the message was received by recvmmsg, so the buffer provided
611611
* must not be freed by the recv_cb callback.
612612
*/
613-
UV_UDP_MMSG_CHUNK = 8
613+
UV_UDP_MMSG_CHUNK = 8,
614+
615+
/*
616+
* Indicates that recvmmsg should be used, if available.
617+
*/
618+
UV_UDP_RECVMMSG = 256
614619
};
615620

616621
typedef void (*uv_udp_send_cb)(uv_udp_send_t* req, int status);

deps/uv/include/uv/version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*/
3232

3333
#define UV_VERSION_MAJOR 1
34-
#define UV_VERSION_MINOR 36
34+
#define UV_VERSION_MINOR 37
3535
#define UV_VERSION_PATCH 0
3636
#define UV_VERSION_IS_RELEASE 1
3737
#define UV_VERSION_SUFFIX ""

deps/uv/src/timer.c

+1-6
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,7 @@ static int timer_less_than(const struct heap_node* ha,
5151
/* Compare start_id when both have the same timeout. start_id is
5252
* allocated with loop->timer_counter in uv_timer_start().
5353
*/
54-
if (a->start_id < b->start_id)
55-
return 1;
56-
if (b->start_id < a->start_id)
57-
return 0;
58-
59-
return 0;
54+
return a->start_id < b->start_id;
6055
}
6156

6257

deps/uv/src/unix/udp.c

+10-6
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,9 @@ static void uv__udp_recvmsg(uv_udp_t* handle) {
262262
assert(buf.base != NULL);
263263

264264
#if HAVE_MMSG
265-
uv_once(&once, uv__udp_mmsg_init);
266-
if (uv__recvmmsg_avail) {
267-
/* Returned space for more than 1 datagram, use it to receive
268-
* multiple datagrams. */
269-
if (buf.len >= 2 * UV__UDP_DGRAM_MAXSIZE) {
265+
if (handle->flags & UV_HANDLE_UDP_RECVMMSG) {
266+
uv_once(&once, uv__udp_mmsg_init);
267+
if (uv__recvmmsg_avail) {
270268
nread = uv__udp_recvmmsg(handle, &buf);
271269
if (nread > 0)
272270
count -= nread;
@@ -949,14 +947,17 @@ static int uv__udp_set_source_membership6(uv_udp_t* handle,
949947
int uv_udp_init_ex(uv_loop_t* loop, uv_udp_t* handle, unsigned int flags) {
950948
int domain;
951949
int err;
950+
int extra_flags;
952951
int fd;
953952

954953
/* Use the lower 8 bits for the domain */
955954
domain = flags & 0xFF;
956955
if (domain != AF_INET && domain != AF_INET6 && domain != AF_UNSPEC)
957956
return UV_EINVAL;
958957

959-
if (flags & ~0xFF)
958+
/* Use the higher bits for extra flags */
959+
extra_flags = flags & ~0xFF;
960+
if (extra_flags & ~UV_UDP_RECVMMSG)
960961
return UV_EINVAL;
961962

962963
if (domain != AF_UNSPEC) {
@@ -977,6 +978,9 @@ int uv_udp_init_ex(uv_loop_t* loop, uv_udp_t* handle, unsigned int flags) {
977978
QUEUE_INIT(&handle->write_queue);
978979
QUEUE_INIT(&handle->write_completed_queue);
979980

981+
if (extra_flags & UV_UDP_RECVMMSG)
982+
handle->flags |= UV_HANDLE_UDP_RECVMMSG;
983+
980984
return 0;
981985
}
982986

deps/uv/src/uv-common.h

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ enum {
104104
/* Only used by uv_udp_t handles. */
105105
UV_HANDLE_UDP_PROCESSING = 0x01000000,
106106
UV_HANDLE_UDP_CONNECTED = 0x02000000,
107+
UV_HANDLE_UDP_RECVMMSG = 0x04000000,
107108

108109
/* Only used by uv_pipe_t handles. */
109110
UV_HANDLE_NON_OVERLAPPED_PIPE = 0x01000000,

0 commit comments

Comments
 (0)