Skip to content

Commit 7e5ef4a

Browse files
cjihrigMylesBorins
authored andcommitted
deps: upgrade to libuv 1.27.0
Notable changes: - `statx()` is used to retrieve file birth times on supported platforms. - Improved support of running under Windows safe mode. - Add support for UDP connected sockets. Several functions can now return `UV_EBADF` instead of `UV_EINVAL`. - SunOS support is improved. Backport-PR-URL: #27728 PR-URL: #26707 Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent f76776b commit 7e5ef4a

Some content is hidden

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

49 files changed

+1146
-200
lines changed

deps/uv/AUTHORS

+2
Original file line numberDiff line numberDiff line change
@@ -369,3 +369,5 @@ Kevin Adler <[email protected]>
369369
Stephen Belanger <[email protected]>
370370
yeyuanfeng <[email protected]>
371371
372+
Thomas Karl Pietrowski <[email protected]>
373+

deps/uv/CMakeLists.txt

+4-2
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ set(uv_test_sources
153153
test/test-tty.c
154154
test/test-udp-alloc-cb-fail.c
155155
test/test-udp-bind.c
156+
test/test-udp-connect.c
156157
test/test-udp-create-socket-early.c
157158
test/test-udp-dgram-too-big.c
158159
test/test-udp-ipv6.c
@@ -351,7 +352,8 @@ target_link_libraries(uv_a ${uv_libraries})
351352
if(BUILD_TESTING)
352353
include(CTest)
353354
add_executable(uv_run_tests ${uv_test_sources})
354-
target_compile_definitions(uv_run_tests PRIVATE ${uv_defines})
355+
target_compile_definitions(uv_run_tests
356+
PRIVATE ${uv_defines} USING_UV_SHARED=1)
355357
target_compile_options(uv_run_tests PRIVATE ${uv_cflags})
356358
target_include_directories(uv_run_tests PRIVATE include)
357359
target_link_libraries(uv_run_tests uv ${uv_test_libraries})
@@ -383,7 +385,7 @@ if(UNIX)
383385

384386
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
385387
install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR})
386-
install(FILES LICENSE ${CMAKE_CURRENT_BINARY_DIR}/libuv.pc
388+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libuv.pc
387389
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
388390
install(TARGETS uv LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
389391
install(TARGETS uv_a ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})

deps/uv/ChangeLog

+59
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,62 @@
1+
2019.03.17, Version 1.27.0 (Stable), a4fc9a66cc35256dbc4dcd67c910174f05b6daa6
2+
3+
Changes since version 1.26.0:
4+
5+
* doc: describe unix signal handling better (Vladimír Čunát)
6+
7+
* linux: use statx() to obtain file birth time (Ben Noordhuis)
8+
9+
* src: fill sockaddr_in6.sin6_len when it's defined (Santiago Gimeno)
10+
11+
* test: relax uv_hrtime() test assumptions (Ben Noordhuis)
12+
13+
* build: make cmake install LICENSE only once (Thomas Karl Pietrowski)
14+
15+
* bsd: plug uv_fs_event_start() error path fd leak (Ben Noordhuis)
16+
17+
* unix: fix __FreeBSD_kernel__ typo (cjihrig)
18+
19+
* doc: add note about uv_run() not being reentrant (Ben Noordhuis)
20+
21+
* unix, win: make fs-poll close wait for resource cleanup (Anna Henningsen)
22+
23+
* doc: fix typo in uv_thread_options_t definition (Ryan Liptak)
24+
25+
* win: skip winsock initialization in safe mode (evgley)
26+
27+
* unix: refactor getsockname/getpeername methods (Santiago Gimeno)
28+
29+
* win,udp: allow to use uv_udp_open on bound sockets (Santiago Gimeno)
30+
31+
* udp: add support for UDP connected sockets (Santiago Gimeno)
32+
33+
* build: fix uv_test shared uv Windows cmake build (ptlomholt)
34+
35+
* build: add android-configure scripts to EXTRA_DIST (Ben Noordhuis)
36+
37+
* build: add missing header (cjihrig)
38+
39+
* sunos: add perror() output prior to abort() (Andrew Paprocki)
40+
41+
* test,sunos: disable UV_DISCONNECT handling (Andrew Paprocki)
42+
43+
* sunos: disable __attribute__((unused)) (Andrew Paprocki)
44+
45+
* test,sunos: use unistd.h code branch (Andrew Paprocki)
46+
47+
* build,sunos: better handling of non-GCC compiler (Andrew Paprocki)
48+
49+
* test,sunos: fix statement not reached warnings (Andrew Paprocki)
50+
51+
* sunos: fix argument/prototype mismatch in atomics (Andrew Paprocki)
52+
53+
* test,sunos: test-ipc.c lacks newline at EOF (Andrew Paprocki)
54+
55+
* test: change spawn_stdin_stdout return to void (Andrew Paprocki)
56+
57+
* test: remove call to floor() in test driver (Andrew Paprocki)
58+
59+
160
2019.02.11, Version 1.26.0 (Stable), 8669d8d3e93cddb62611b267ef62a3ddb5ba3ca0
261

362
Changes since version 1.25.0:

deps/uv/Makefile.am

+20-4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ libuv_la_LDFLAGS = -no-undefined -version-info 1:0:0
3232
libuv_la_SOURCES = src/fs-poll.c \
3333
src/heap-inl.h \
3434
src/idna.c \
35+
src/idna.h \
3536
src/inet.c \
3637
src/queue.h \
3738
src/strscpy.c \
@@ -44,10 +45,12 @@ libuv_la_SOURCES = src/fs-poll.c \
4445
src/version.c
4546

4647
if SUNOS
48+
if GCC
4749
# Can't be turned into a CC_CHECK_CFLAGS in configure.ac, it makes compilers
4850
# on other platforms complain that the argument is unused during compilation.
4951
libuv_la_CFLAGS += -pthreads
5052
endif
53+
endif
5154

5255
if WINNT
5356

@@ -121,11 +124,13 @@ EXTRA_DIST = test/fixtures/empty_file \
121124
docs \
122125
img \
123126
samples \
124-
android-configure \
127+
android-configure-arm \
128+
android-configure-arm64 \
129+
android-configure-x86 \
130+
android-configure-x86_64 \
125131
CONTRIBUTING.md \
126132
LICENSE \
127133
README.md \
128-
checksparse.sh \
129134
vcbuild.bat \
130135
common.gypi \
131136
gyp_uv.py \
@@ -138,14 +143,20 @@ check_PROGRAMS = test/run-tests
138143
if OS390
139144
test_run_tests_CFLAGS =
140145
else
146+
if GCC
141147
test_run_tests_CFLAGS = -Wno-long-long
148+
else
149+
test_run_tests_CFLAGS =
150+
endif
142151
endif
143152

144153
if SUNOS
154+
if GCC
145155
# Can't be turned into a CC_CHECK_CFLAGS in configure.ac, it makes compilers
146156
# on other platforms complain that the argument is unused during compilation.
147157
test_run_tests_CFLAGS += -pthreads
148158
endif
159+
endif
149160

150161
test_run_tests_LDFLAGS =
151162
test_run_tests_SOURCES = test/blackhole-server.c \
@@ -281,6 +292,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
281292
test/test-tty.c \
282293
test/test-udp-alloc-cb-fail.c \
283294
test/test-udp-bind.c \
295+
test/test-udp-connect.c \
284296
test/test-udp-create-socket-early.c \
285297
test/test-udp-dgram-too-big.c \
286298
test/test-udp-ipv6.c \
@@ -320,7 +332,9 @@ test_run_tests_CFLAGS += -D_GNU_SOURCE
320332
endif
321333

322334
if SUNOS
323-
test_run_tests_CFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
335+
test_run_tests_CFLAGS += -D__EXTENSIONS__ \
336+
-D_XOPEN_SOURCE=500 \
337+
-D_REENTRANT
324338
endif
325339

326340
if OS390
@@ -458,7 +472,9 @@ endif
458472

459473
if SUNOS
460474
uvinclude_HEADERS += include/uv/sunos.h
461-
libuv_la_CFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
475+
libuv_la_CFLAGS += -D__EXTENSIONS__ \
476+
-D_XOPEN_SOURCE=500 \
477+
-D_REENTRANT
462478
libuv_la_SOURCES += src/unix/no-proctitle.c \
463479
src/unix/sunos.c
464480
endif

deps/uv/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ $ make -C out
312312
The default API level is 24, but a different one can be selected as follows:
313313

314314
```bash
315-
$ source ./android-configure ~/android-ndk-r15b gyp 21
315+
$ source ./android-configure-arm ~/android-ndk-r15b gyp 21
316316
$ make -C out
317317
```
318318

deps/uv/configure.ac

+12-9
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.26.0], [https://github.com/libuv/libuv/issues])
16+
AC_INIT([libuv], [1.27.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])
@@ -24,16 +24,18 @@ AC_ENABLE_SHARED
2424
AC_ENABLE_STATIC
2525
AC_PROG_CC
2626
AM_PROG_CC_C_O
27-
AS_IF([AS_CASE([$host_os],[openedition*], [false], [true])], [
28-
CC_CHECK_CFLAGS_APPEND([-pedantic])
29-
])
3027
CC_FLAG_VISIBILITY #[-fvisibility=hidden]
3128
CC_CHECK_CFLAGS_APPEND([-g])
32-
CC_CHECK_CFLAGS_APPEND([-std=gnu89])
33-
CC_CHECK_CFLAGS_APPEND([-Wall])
34-
CC_CHECK_CFLAGS_APPEND([-Wextra])
35-
CC_CHECK_CFLAGS_APPEND([-Wno-unused-parameter])
36-
CC_CHECK_CFLAGS_APPEND([-Wstrict-prototypes])
29+
AS_IF([test "x$GCC" = xyes], [
30+
AS_IF([AS_CASE([$host_os], [openedition*], [false], [true])], [
31+
CC_CHECK_CFLAGS_APPEND([-pedantic])
32+
])
33+
CC_CHECK_CFLAGS_APPEND([-std=gnu89])
34+
CC_CHECK_CFLAGS_APPEND([-Wall])
35+
CC_CHECK_CFLAGS_APPEND([-Wextra])
36+
CC_CHECK_CFLAGS_APPEND([-Wno-unused-parameter])
37+
CC_CHECK_CFLAGS_APPEND([-Wstrict-prototypes])
38+
])
3739
# AM_PROG_AR is not available in automake v0.11 but it's essential in v0.12.
3840
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
3941
# autoconf complains if AC_PROG_LIBTOOL precedes AM_PROG_AR.
@@ -50,6 +52,7 @@ AC_CHECK_LIB([rt], [clock_gettime])
5052
AC_CHECK_LIB([sendfile], [sendfile])
5153
AC_CHECK_LIB([socket], [socket])
5254
AC_SYS_LARGEFILE
55+
AM_CONDITIONAL([GCC], [AS_IF([test "x$GCC" = xyes], [true], [false])])
5356
AM_CONDITIONAL([AIX], [AS_CASE([$host_os],[aix*], [true], [false])])
5457
AM_CONDITIONAL([ANDROID], [AS_CASE([$host_os],[linux-android*],[true], [false])])
5558
AM_CONDITIONAL([CYGWIN], [AS_CASE([$host_os],[cygwin*], [true], [false])])

deps/uv/docs/src/loop.rst

+2
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ API
107107
or requests left), or non-zero if more callbacks are expected (meaning
108108
you should run the event loop again sometime in the future).
109109
110+
:c:func:`uv_run` is not reentrant. It must not be called from a callback.
111+
110112
.. c:function:: int uv_loop_alive(const uv_loop_t* loop)
111113
112114
Returns non-zero if there are referenced active handles, active

deps/uv/docs/src/signal.rst

+18-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66

77
Signal handles implement Unix style signal handling on a per-event loop bases.
88

9-
Reception of some signals is emulated on Windows:
9+
Windows notes
10+
-------------
11+
12+
Reception of some signals is emulated:
1013

1114
* SIGINT is normally delivered when the user presses CTRL+C. However, like
1215
on Unix, it is not generated when terminal raw mode is enabled.
@@ -24,13 +27,22 @@ Reception of some signals is emulated on Windows:
2427
* Calls to raise() or abort() to programmatically raise a signal are
2528
not detected by libuv; these will not trigger a signal watcher.
2629

27-
.. note::
28-
On Linux SIGRT0 and SIGRT1 (signals 32 and 33) are used by the NPTL pthreads library to
29-
manage threads. Installing watchers for those signals will lead to unpredictable behavior
30-
and is strongly discouraged. Future versions of libuv may simply reject them.
31-
3230
.. versionchanged:: 1.15.0 SIGWINCH support on Windows was improved.
3331

32+
Unix notes
33+
----------
34+
35+
* SIGKILL and SIGSTOP are impossible to catch.
36+
37+
* Handling SIGBUS, SIGFPE, SIGILL or SIGSEGV via libuv results into undefined behavior.
38+
39+
* SIGABRT will not be caught by libuv if generated by `abort()`, e.g. through `assert()`.
40+
41+
* On Linux SIGRT0 and SIGRT1 (signals 32 and 33) are used by the NPTL pthreads library to
42+
manage threads. Installing watchers for those signals will lead to unpredictable behavior
43+
and is strongly discouraged. Future versions of libuv may simply reject them.
44+
45+
3446
Data types
3547
----------
3648

deps/uv/docs/src/threading.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ Threads
6161

6262
::
6363

64-
typedef struct uv_process_options_s {
64+
typedef struct uv_thread_options_s {
6565
enum {
6666
UV_THREAD_NO_FLAGS = 0x00,
6767
UV_THREAD_HAS_STACK_SIZE = 0x01
6868
} flags;
6969
size_t stack_size;
70-
} uv_process_options_t;
70+
} uv_thread_options_t;
7171

7272
More fields may be added to this struct at any time, so its exact
7373
layout and size should not be relied upon.

deps/uv/docs/src/udp.rst

+54
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,44 @@ API
150150
151151
:returns: 0 on success, or an error code < 0 on failure.
152152
153+
.. c:function:: int uv_udp_connect(uv_udp_t* handle, const struct sockaddr* addr)
154+
155+
Associate the UDP handle to a remote address and port, so every
156+
message sent by this handle is automatically sent to that destination.
157+
Calling this function with a `NULL` `addr` disconnects the handle.
158+
Trying to call `uv_udp_connect()` on an already connected handle will result
159+
in an `UV_EISCONN` error. Trying to disconnect a handle that is not
160+
connected will return an `UV_ENOTCONN` error.
161+
162+
:param handle: UDP handle. Should have been initialized with
163+
:c:func:`uv_udp_init`.
164+
165+
:param addr: `struct sockaddr_in` or `struct sockaddr_in6`
166+
with the address and port to associate to.
167+
168+
:returns: 0 on success, or an error code < 0 on failure.
169+
170+
.. versionadded:: 1.27.0
171+
172+
.. c:function:: int uv_udp_getpeername(const uv_udp_t* handle, struct sockaddr* name, int* namelen)
173+
174+
Get the remote IP and port of the UDP handle on connected UDP handles.
175+
On unconnected handles, it returns `UV_ENOTCONN`.
176+
177+
:param handle: UDP handle. Should have been initialized with
178+
:c:func:`uv_udp_init` and bound.
179+
180+
:param name: Pointer to the structure to be filled with the address data.
181+
In order to support IPv4 and IPv6 `struct sockaddr_storage` should be
182+
used.
183+
184+
:param namelen: On input it indicates the data of the `name` field. On
185+
output it indicates how much of it was filled.
186+
187+
:returns: 0 on success, or an error code < 0 on failure
188+
189+
.. versionadded:: 1.27.0
190+
153191
.. c:function:: int uv_udp_getsockname(const uv_udp_t* handle, struct sockaddr* name, int* namelen)
154192
155193
Get the local IP and port of the UDP handle.
@@ -247,6 +285,12 @@ API
247285
(``0.0.0.0`` or ``::``) it will be changed to point to ``localhost``.
248286
This is done to match the behavior of Linux systems.
249287
288+
For connected UDP handles, `addr` must be set to `NULL`, otherwise it will
289+
return `UV_EISCONN` error.
290+
291+
For connectionless UDP handles, `addr` cannot be `NULL`, otherwise it will
292+
return `UV_EDESTADDRREQ` error.
293+
250294
:param req: UDP request handle. Need not be initialized.
251295
252296
:param handle: UDP handle. Should have been initialized with
@@ -266,15 +310,25 @@ API
266310
.. versionchanged:: 1.19.0 added ``0.0.0.0`` and ``::`` to ``localhost``
267311
mapping
268312
313+
.. versionchanged:: 1.27.0 added support for connected sockets
314+
269315
.. c:function:: int uv_udp_try_send(uv_udp_t* handle, const uv_buf_t bufs[], unsigned int nbufs, const struct sockaddr* addr)
270316
271317
Same as :c:func:`uv_udp_send`, but won't queue a send request if it can't
272318
be completed immediately.
273319
320+
For connected UDP handles, `addr` must be set to `NULL`, otherwise it will
321+
return `UV_EISCONN` error.
322+
323+
For connectionless UDP handles, `addr` cannot be `NULL`, otherwise it will
324+
return `UV_EDESTADDRREQ` error.
325+
274326
:returns: >= 0: number of bytes sent (it matches the given buffer size).
275327
< 0: negative error code (``UV_EAGAIN`` is returned when the message
276328
can't be sent immediately).
277329
330+
.. versionchanged:: 1.27.0 added support for connected sockets
331+
278332
.. c:function:: int uv_udp_recv_start(uv_udp_t* handle, uv_alloc_cb alloc_cb, uv_udp_recv_cb recv_cb)
279333
280334
Prepare for receiving data. If the socket has not previously been bound

deps/uv/include/uv.h

+4
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,11 @@ UV_EXTERN int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock);
630630
UV_EXTERN int uv_udp_bind(uv_udp_t* handle,
631631
const struct sockaddr* addr,
632632
unsigned int flags);
633+
UV_EXTERN int uv_udp_connect(uv_udp_t* handle, const struct sockaddr* addr);
633634

635+
UV_EXTERN int uv_udp_getpeername(const uv_udp_t* handle,
636+
struct sockaddr* name,
637+
int* namelen);
634638
UV_EXTERN int uv_udp_getsockname(const uv_udp_t* handle,
635639
struct sockaddr* name,
636640
int* namelen);

0 commit comments

Comments
 (0)