Skip to content

Commit f5f238d

Browse files
cjihrigBridgeAR
authored andcommitted
deps: upgrade to libuv 1.32.0
Notable changes: - `uv_tcp_close_reset()` has been added. - `uv_udp_set_source_membership()` has been added. - A double free in `uv_free_cpu_info()` on OpenBSD has been fixed. - Defined, but empty environment variables can now be read on Windows. - Several improvements to the cmake build process. - The `EILSEQ` error code is now mapped by libuv. PR-URL: #29508 Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Beth Griggs <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 87fd55c commit f5f238d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1176
-251
lines changed

deps/uv/AUTHORS

+7
Original file line numberDiff line numberDiff line change
@@ -396,3 +396,10 @@ Nan Xiao <[email protected]>
396396
Ben Davies <[email protected]>
397397
Nhan Khong <[email protected]>
398398
399+
Tomas Krizek <[email protected]>
400+
Konstantin Podsvirov <[email protected]>
401+
402+
Vladimir Karnushin <[email protected]>
403+
404+
Eneas U de Queiroz <[email protected]>
405+
Daniel Hahler <[email protected]>

deps/uv/CMakeLists.txt

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# TODO: determine CMAKE_SYSTEM_NAME on OS/390. Currently assumes "OS/390".
2-
cmake_minimum_required(VERSION 3.0)
2+
cmake_minimum_required(VERSION 2.8.12)
33
project(libuv)
44

55
if(MSVC)
@@ -116,6 +116,7 @@ set(uv_test_sources
116116
test/test-shutdown-eof.c
117117
test/test-shutdown-twice.c
118118
test/test-signal-multiple-loops.c
119+
test/test-signal-pending-on-close.c
119120
test/test-signal.c
120121
test/test-socket-buffer-size.c
121122
test/test-spawn.c
@@ -127,6 +128,7 @@ set(uv_test_sources
127128
test/test-tcp-close-accept.c
128129
test/test-tcp-close-while-connecting.c
129130
test/test-tcp-close.c
131+
test/test-tcp-close-reset.c
130132
test/test-tcp-connect-error-after-write.c
131133
test/test-tcp-connect-error.c
132134
test/test-tcp-connect-timeout.c
@@ -317,6 +319,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OS/390")
317319
list(APPEND uv_defines _OPEN_MSGQ_EXT)
318320
list(APPEND uv_defines _OPEN_SYS_FILE_EXT)
319321
list(APPEND uv_defines _OPEN_SYS_IF_EXT)
322+
list(APPEND uv_defines _OPEN_SYS_SOCK_EXT3)
320323
list(APPEND uv_defines _OPEN_SYS_SOCK_IPV6)
321324
list(APPEND uv_defines _UNIX03_SOURCE)
322325
list(APPEND uv_defines _UNIX03_THREADS)
@@ -340,15 +343,17 @@ if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|Linux|NetBSD|OpenBSD")
340343
endif()
341344

342345
add_library(uv SHARED ${uv_sources})
343-
target_compile_definitions(uv PRIVATE ${uv_defines} BUILDING_UV_SHARED=1)
346+
target_compile_definitions(uv
347+
INTERFACE USING_UV_SHARED=1
348+
PRIVATE ${uv_defines} BUILDING_UV_SHARED=1)
344349
target_compile_options(uv PRIVATE ${uv_cflags})
345-
target_include_directories(uv PRIVATE include src)
350+
target_include_directories(uv PUBLIC include PRIVATE src)
346351
target_link_libraries(uv ${uv_libraries})
347352

348353
add_library(uv_a STATIC ${uv_sources})
349354
target_compile_definitions(uv_a PRIVATE ${uv_defines})
350355
target_compile_options(uv_a PRIVATE ${uv_cflags})
351-
target_include_directories(uv_a PRIVATE include src)
356+
target_include_directories(uv_a PUBLIC include PRIVATE src)
352357
target_link_libraries(uv_a ${uv_libraries})
353358

354359
option(libuv_buildtests "Build the unit tests when BUILD_TESTING is enabled." ON)
@@ -360,15 +365,13 @@ if(BUILD_TESTING AND libuv_buildtests)
360365
target_compile_definitions(uv_run_tests
361366
PRIVATE ${uv_defines} USING_UV_SHARED=1)
362367
target_compile_options(uv_run_tests PRIVATE ${uv_cflags})
363-
target_include_directories(uv_run_tests PRIVATE include)
364368
target_link_libraries(uv_run_tests uv ${uv_test_libraries})
365369
add_test(NAME uv_test
366370
COMMAND uv_run_tests
367371
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
368372
add_executable(uv_run_tests_a ${uv_test_sources})
369373
target_compile_definitions(uv_run_tests_a PRIVATE ${uv_defines})
370374
target_compile_options(uv_run_tests_a PRIVATE ${uv_cflags})
371-
target_include_directories(uv_run_tests_a PRIVATE include)
372375
target_link_libraries(uv_run_tests_a uv_a ${uv_test_libraries})
373376
add_test(NAME uv_test_a
374377
COMMAND uv_run_tests_a
@@ -383,6 +386,10 @@ if(UNIX)
383386
endforeach(x)
384387
file(STRINGS configure.ac configure_ac REGEX ^AC_INIT)
385388
string(REGEX MATCH [0-9]+[.][0-9]+[.][0-9]+ PACKAGE_VERSION "${configure_ac}")
389+
string(REGEX MATCH ^[0-9]+ UV_VERSION_MAJOR "${PACKAGE_VERSION}")
390+
# The version in the filename is mirroring the behaviour of autotools.
391+
set_target_properties(uv PROPERTIES VERSION ${UV_VERSION_MAJOR}.0.0
392+
SOVERSION ${UV_VERSION_MAJOR})
386393
set(includedir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
387394
set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
388395
set(prefix ${CMAKE_INSTALL_PREFIX})

deps/uv/ChangeLog

+75
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,78 @@
1+
2019.09.10, Version 1.32.0 (Stable), 697bea87b3a0b0e9b4e5ff86b39d1dedb70ee46d
2+
3+
Changes since version 1.31.0:
4+
5+
* misc: enable stalebot (Saúl Ibarra Corretgé)
6+
7+
* win: map ERROR_ENVVAR_NOT_FOUND to UV_ENOENT (cjihrig)
8+
9+
* win: use L'\0' as UTF-16 null terminator (cjihrig)
10+
11+
* win: support retrieving empty env variables (cjihrig)
12+
13+
* unix,stream: fix returned error codes (Santiago Gimeno)
14+
15+
* test: fix typo in DYLD_LIBRARY_PATH (Ben Noordhuis)
16+
17+
* unix,signal: keep handle active if pending signal (Santiago Gimeno)
18+
19+
* openbsd: fix uv_cpu_info (Santiago Gimeno)
20+
21+
* src: move uv_free_cpu_info to uv-common.c (Santiago Gimeno)
22+
23+
* tcp: add uv_tcp_close_reset method (Santiago Gimeno)
24+
25+
* test: fix udp-multicast-join tests (Santiago Gimeno)
26+
27+
* test: remove assertion in fs_statfs test (cjihrig)
28+
29+
* doc: clarify uv_buf_t usage in uv_alloc_cb (Tomas Krizek)
30+
31+
* win: fix typo in preprocessor expression (Konstantin Podsvirov)
32+
33+
* timer: fix uv_timer_start on closing timer (seny)
34+
35+
* udp: add source-specific multicast support (Vladimir Karnushin)
36+
37+
* udp: fix error return values (Santiago Gimeno)
38+
39+
* udp: drop IPV6_SSM_SUPPORT macro (Santiago Gimeno)
40+
41+
* udp: fix uv__udp_set_source_membership6 (Santiago Gimeno)
42+
43+
* udp: use sockaddr_storage instead of union (Santiago Gimeno)
44+
45+
* build,zos: add _OPEN_SYS_SOCK_EXT3 flag (Santiago Gimeno)
46+
47+
* test: add specific source multicast tests (Santiago Gimeno)
48+
49+
* include: map EILSEQ error code (cjihrig)
50+
51+
* win, tty: improve SIGWINCH performance (Bartosz Sosnowski)
52+
53+
* build: fix ios build error (MaYuming)
54+
55+
* aix: replace ECONNRESET with EOF if already closed (Milad Farazmand)
56+
57+
* build: add cmake library VERSION, SOVERSION (Eneas U de Queiroz)
58+
59+
* build: make include/ public in CMakeLists.txt (Ben Noordhuis)
60+
61+
* build: export USING_UV_SHARED=1 to cmake deps (Ben Noordhuis)
62+
63+
* build: cmake_minimum_required(VERSION 2.8.12) (Daniel Hahler)
64+
65+
* aix: Fix broken cmpxchgi() XL C++ specialization. (Andrew Paprocki)
66+
67+
* test: fix -Wsign-compare warning (Ben Noordhuis)
68+
69+
* unix: simplify open(O_CLOEXEC) feature detection (Ben Noordhuis)
70+
71+
* unix: fix UV_FS_O_DIRECT definition on Linux (Joran Dirk Greef)
72+
73+
* doc: uv_handle_t documentation suggestion (Daniel Bevenius)
74+
75+
176
2019.08.10, Version 1.31.0 (Stable), 0a6771cee4c15184c924bfe9d397bdd0c3b206ba
277

378
Changes since version 1.30.1:

deps/uv/Makefile.am

+3
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
248248
test/test-shutdown-eof.c \
249249
test/test-shutdown-twice.c \
250250
test/test-signal-multiple-loops.c \
251+
test/test-signal-pending-on-close.c \
251252
test/test-signal.c \
252253
test/test-socket-buffer-size.c \
253254
test/test-spawn.c \
@@ -259,6 +260,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
259260
test/test-tcp-close-accept.c \
260261
test/test-tcp-close-while-connecting.c \
261262
test/test-tcp-close.c \
263+
test/test-tcp-close-reset.c \
262264
test/test-tcp-create-socket-early.c \
263265
test/test-tcp-connect-error-after-write.c \
264266
test/test-tcp-connect-error.c \
@@ -517,6 +519,7 @@ libuv_la_CFLAGS += -D_UNIX03_THREADS \
517519
-D_XOPEN_SOURCE_EXTENDED \
518520
-D_ALL_SOURCE \
519521
-D_LARGE_TIME_API \
522+
-D_OPEN_SYS_SOCK_EXT3 \
520523
-D_OPEN_SYS_SOCK_IPV6 \
521524
-D_OPEN_SYS_FILE_EXT \
522525
-DUV_PLATFORM_SEM_T=int \

deps/uv/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,8 @@ Check the [SUPPORTED_PLATFORMS file](SUPPORTED_PLATFORMS.md).
401401

402402
### AIX Notes
403403

404+
AIX compilation using IBM XL C/C++ requires version 12.1 or greater.
405+
404406
AIX support for filesystem events requires the non-default IBM `bos.ahafs`
405407
package to be installed. This package provides the AIX Event Infrastructure
406408
that is detected by `autoconf`.

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.31.0], [https://github.com/libuv/libuv/issues])
16+
AC_INIT([libuv], [1.32.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/handle.rst

+4-1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ Data types
6060
a ``UV_ENOBUFS`` error will be triggered in the :c:type:`uv_udp_recv_cb` or the
6161
:c:type:`uv_read_cb` callback.
6262

63+
Each buffer is used only once and the user is responsible for freeing it in the
64+
:c:type:`uv_udp_recv_cb` or the :c:type:`uv_read_cb` callback.
65+
6366
A suggested size (65536 at the moment in most cases) is provided, but it's just an indication,
6467
not related in any way to the pending data to be read. The user is free to allocate the amount
6568
of memory they decide.
@@ -87,7 +90,7 @@ Public members
8790

8891
.. c:member:: uv_loop_t* uv_handle_t.loop
8992
90-
Pointer to the :c:type:`uv_loop_t` where the handle is running on. Readonly.
93+
Pointer to the :c:type:`uv_loop_t` the handle is running on. Readonly.
9194

9295
.. c:member:: uv_handle_type uv_handle_t.type
9396

deps/uv/docs/src/signal.rst

+11
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ Reception of some signals is emulated:
2020
program is given approximately 10 seconds to perform cleanup. After that
2121
Windows will unconditionally terminate it.
2222

23+
* SIGWINCH is raised whenever libuv detects that the console has been
24+
resized. When a libuv app is running under a console emulator, or when a
25+
32-bit libuv app is running on 64-bit system, SIGWINCH will be emulated. In
26+
such cases SIGWINCH signals may not always be delivered in a timely manner.
27+
For a writable :c:type:`uv_tty_t` handle libuv will only detect size changes
28+
when the cursor is moved. When a readable :c:type:`uv_tty_t` handle is used,
29+
resizing of the console buffer will be detected only if the handle is in raw
30+
mode and is being read.
31+
2332
* Watchers for other signals can be successfully created, but these signals
2433
are never received. These signals are: `SIGILL`, `SIGABRT`, `SIGFPE`, `SIGSEGV`,
2534
`SIGTERM` and `SIGKILL.`
@@ -28,6 +37,8 @@ Reception of some signals is emulated:
2837
not detected by libuv; these will not trigger a signal watcher.
2938

3039
.. versionchanged:: 1.15.0 SIGWINCH support on Windows was improved.
40+
.. versionchanged:: 1.31.0 32-bit libuv SIGWINCH support on 64-bit Windows was
41+
rolled back to old implementation.
3142

3243
Unix notes
3344
----------

deps/uv/docs/src/stream.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ Data types
5050
from the stream again is undefined.
5151

5252
The callee is responsible for freeing the buffer, libuv does not reuse it.
53-
The buffer may be a null buffer (where buf->base=NULL and buf->len=0) on
54-
error.
53+
The buffer may be a null buffer (where `buf->base` == NULL and `buf->len` == 0)
54+
on error.
5555

5656
.. c:type:: void (*uv_write_cb)(uv_write_t* req, int status)
5757

deps/uv/docs/src/tcp.rst

+10
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,13 @@ API
113113
mapping
114114
115115
.. seealso:: The :c:type:`uv_stream_t` API functions also apply.
116+
117+
.. c:function:: int uv_tcp_close_reset(uv_tcp_t* handle, uv_close_cb close_cb)
118+
119+
Resets a TCP connection by sending a RST packet. This is accomplished by
120+
setting the `SO_LINGER` socket option with a linger interval of zero and
121+
then calling :c:func:`uv_close`.
122+
Due to some platform inconsistencies, mixing of :c:func:`uv_shutdown` and
123+
:c:func:`uv_tcp_close_reset` calls is not allowed.
124+
125+
.. versionadded:: 1.32.0

deps/uv/docs/src/udp.rst

+26-4
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,19 @@ Data types
5656

5757
* `handle`: UDP handle
5858
* `nread`: Number of bytes that have been received.
59-
0 if there is no more data to read. You may discard or repurpose
60-
the read buffer. Note that 0 may also mean that an empty datagram
61-
was received (in this case `addr` is not NULL). < 0 if a transmission
62-
error was detected.
59+
0 if there is no more data to read. Note that 0 may also mean that an
60+
empty datagram was received (in this case `addr` is not NULL). < 0 if
61+
a transmission error was detected.
6362
* `buf`: :c:type:`uv_buf_t` with the received data.
6463
* `addr`: ``struct sockaddr*`` containing the address of the sender.
6564
Can be NULL. Valid for the duration of the callback only.
6665
* `flags`: One or more or'ed UV_UDP_* constants. Right now only
6766
``UV_UDP_PARTIAL`` is used.
6867

68+
The callee is responsible for freeing the buffer, libuv does not reuse it.
69+
The buffer may be a null buffer (where `buf->base` == NULL and `buf->len` == 0)
70+
on error.
71+
6972
.. note::
7073
The receive callback will be called with `nread` == 0 and `addr` == NULL when there is
7174
nothing to read, and with `nread` == 0 and `addr` != NULL when an empty UDP packet is
@@ -219,6 +222,25 @@ API
219222
220223
:returns: 0 on success, or an error code < 0 on failure.
221224
225+
.. c:function:: int uv_udp_set_source_membership(uv_udp_t* handle, const char* multicast_addr, const char* interface_addr, const char* source_addr, uv_membership membership)
226+
227+
Set membership for a source-specific multicast group.
228+
229+
:param handle: UDP handle. Should have been initialized with
230+
:c:func:`uv_udp_init`.
231+
232+
:param multicast_addr: Multicast address to set membership for.
233+
234+
:param interface_addr: Interface address.
235+
236+
:param source_addr: Source address.
237+
238+
:param membership: Should be ``UV_JOIN_GROUP`` or ``UV_LEAVE_GROUP``.
239+
240+
:returns: 0 on success, or an error code < 0 on failure.
241+
242+
.. versionadded:: 1.32.0
243+
222244
.. c:function:: int uv_udp_set_multicast_loop(uv_udp_t* handle, int on)
223245
224246
Set IP multicast loop flag. Makes multicast packets loop back to

deps/uv/include/uv.h

+11
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
extern "C" {
2828
#endif
2929

30+
#if defined(BUILDING_UV_SHARED) && defined(USING_UV_SHARED)
31+
#error "Define either BUILDING_UV_SHARED or USING_UV_SHARED, not both."
32+
#endif
33+
3034
#ifdef _WIN32
3135
/* Windows - set up dll import/export decorators. */
3236
# if defined(BUILDING_UV_SHARED)
@@ -143,6 +147,7 @@ extern "C" {
143147
XX(EREMOTEIO, "remote I/O error") \
144148
XX(ENOTTY, "inappropriate ioctl for device") \
145149
XX(EFTYPE, "inappropriate file type or format") \
150+
XX(EILSEQ, "illegal byte sequence") \
146151

147152
#define UV_HANDLE_TYPE_MAP(XX) \
148153
XX(ASYNC, async) \
@@ -559,6 +564,7 @@ UV_EXTERN int uv_tcp_getsockname(const uv_tcp_t* handle,
559564
UV_EXTERN int uv_tcp_getpeername(const uv_tcp_t* handle,
560565
struct sockaddr* name,
561566
int* namelen);
567+
UV_EXTERN int uv_tcp_close_reset(uv_tcp_t* handle, uv_close_cb close_cb);
562568
UV_EXTERN int uv_tcp_connect(uv_connect_t* req,
563569
uv_tcp_t* handle,
564570
const struct sockaddr* addr,
@@ -645,6 +651,11 @@ UV_EXTERN int uv_udp_set_membership(uv_udp_t* handle,
645651
const char* multicast_addr,
646652
const char* interface_addr,
647653
uv_membership membership);
654+
UV_EXTERN int uv_udp_set_source_membership(uv_udp_t* handle,
655+
const char* multicast_addr,
656+
const char* interface_addr,
657+
const char* source_addr,
658+
uv_membership membership);
648659
UV_EXTERN int uv_udp_set_multicast_loop(uv_udp_t* handle, int on);
649660
UV_EXTERN int uv_udp_set_multicast_ttl(uv_udp_t* handle, int ttl);
650661
UV_EXTERN int uv_udp_set_multicast_interface(uv_udp_t* handle,

deps/uv/include/uv/errno.h

+5
Original file line numberDiff line numberDiff line change
@@ -439,5 +439,10 @@
439439
# define UV__EFTYPE (-4028)
440440
#endif
441441

442+
#if defined(EILSEQ) && !defined(_WIN32)
443+
# define UV__EILSEQ UV__ERR(EILSEQ)
444+
#else
445+
# define UV__EILSEQ (-4027)
446+
#endif
442447

443448
#endif /* UV_ERRNO_H_ */

0 commit comments

Comments
 (0)