Commit Graph

1260 Commits

Author SHA1 Message Date
Ben Noordhuis
087c461ee9 unix: make uv_fs_read() fill all buffers
The fallback for systems that lack preadv() only filled the first
buffer.

This commit rectifies that to fill all (or at least as many as possible)
buffers.

Fixes: https://github.com/libuv/libuv/issues/2332
PR-URL: https://github.com/libuv/libuv/pull/2338
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2019-06-20 12:06:31 +02:00
Ben Noordhuis
6e18112127 unix: make uv_cwd() report UV_ENOBUFS
Make uv_cwd() do what the documentation says it did when the destination
buffer is too small: report UV_ENOBUFS and set the `size` in/out param
to the size of the path including the trailing nul byte.

Fixes: https://github.com/libuv/libuv/issues/2333
PR-URL: https://github.com/libuv/libuv/pull/2335
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2019-06-20 12:04:16 +02:00
Anna Henningsen
ee24ce900e
unix: return actual error from uv_try_write()
So far, for some (?) errors, `uv_try_write()` returns `EAGAIN`
regardless of the actual error, so `ECONNRESET` and `EPIPE` errors
can be swallowed here.

This commit changes `uv_try_write()` so that it prefers to return
the actual error it has seen.

PR-URL: https://github.com/libuv/libuv/pull/2321
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2019-06-10 15:17:21 +02:00
Leorize
abe4f3d58d build, core, unix: add support for Haiku
This commit add support for Haiku, an open-source operating system
inspired by BeOS.

PR-URL: https://github.com/libuv/libuv/pull/2301
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-06-07 09:57:06 +02:00
cjihrig
fddcd14825
test: increase test timeout
The test threadpool_multiple_event_loops has been timing
out consistently on FreeBSD in the CI. This commit attempts
to mitigate the problem by extending the test timeout.

PR-URL: https://github.com/libuv/libuv/pull/2304
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2019-05-21 08:50:33 -04:00
Kelvin Jin
c4e9657d59
unix,win: add uv_get_constrained_memory()
Fixes: https://github.com/libuv/libuv/issues/2286
PR-URL: https://github.com/libuv/libuv/pull/2289
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-05-15 11:35:05 -04:00
Anna Henningsen
6c760b6207 unix,win: fix uv_fs_poll_stop() when active
Fix `uv_fs_poll_stop()` for active handles by not attempting to
mark the `uv_fs_poll_t` handle as closing when `uv_close()`
hasn’t been called on it.

Fixes: https://github.com/libuv/libuv/issues/2287
PR-URL: https://github.com/libuv/libuv/pull/2288
Refs: https://github.com/libuv/libuv/pull/1875
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2019-05-06 15:02:01 +02:00
Ben Noordhuis
a74e54bc8f unix: don't assert on UV_PROCESS_WINDOWS_* flags
UV_PROCESS_WINDOWS_HIDE_CONSOLE and UV_PROCESS_WINDOWS_HIDE_GUI were
whitelisted on Windows but not Unices. Now they are.

Bug introduced in commit 4c2dcca27 ("win: support more fine-grained
windows hiding") which I reviewed but where I failed to spot it. Mea
culpa.

Fixes: https://github.com/libuv/libuv/issues/2266
PR-URL: https://github.com/libuv/libuv/pull/2278
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Kyle Edwards <kyle.edwards@kitware.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2019-04-23 21:47:21 +02:00
Ben Noordhuis
cb30144f52 test: test zero-sized uv_fs_sendfile() writes
This was reported as a bug in November 2018 but it appears to be working
now. Add a regression test to ensure it stays that way.

Fixes: https://github.com/libuv/libuv/issues/2076
PR-URL: https://github.com/libuv/libuv/pull/2279
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2019-04-23 21:43:23 +02:00
Oscar Waddell
1c2dc9c8d1 linux: init st_flags and st_gen when using statx
Explicitly initialize uv_stat_t fields st_flags and st_gen when using
statx as uv__to_stat does when statx is not available. This makes
valgrind happier.

PR-URL: https://github.com/libuv/libuv/pull/2263
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
2019-04-23 11:28:10 +02:00
cjihrig
2e090c8f2c
unix,win: introduce uv_timeval64_t
Fixes: https://github.com/libuv/libuv/issues/2243
PR-URL: https://github.com/libuv/libuv/pull/2246
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-04-11 14:08:17 -04:00
Yury Selivanov
89a027d862
unix: support sockaddr_un in uv_udp_send()
PR-URL: https://github.com/libuv/libuv/pull/2220
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-04-11 11:04:43 -04:00
Rich Trott
c7b87b0d51
fs: add test for copyfile() respecting permissions
Add test to test-fs-copyfile.c to check that uv_fs_copyfile() respects
destination file permissions. Previously, in macOS, it did not.

PR-URL: https://github.com/libuv/libuv/pull/2233
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2019-04-10 21:47:41 -04:00
cjihrig
99440bb673
unix,win: add uv_fs_{open,read,close}dir()
Co-authored-by: Julien Gilli <jgilli@nodejs.org>
Co-authored-by: Jeremy Whitlock <jwhitlock@apache.org>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/libuv/libuv/pull/2057
Refs: https://github.com/joyent/libuv/issues/1430
Refs: https://github.com/joyent/libuv/pull/1521
Refs: https://github.com/joyent/libuv/pull/1574
Refs: https://github.com/libuv/libuv/pull/175
Refs: https://github.com/nodejs/node/issues/583
Refs: https://github.com/libuv/libuv/pull/416
Refs: https://github.com/libuv/libuv/issues/170
2019-03-26 18:47:51 -04:00
cjihrig
575d41481e
unix,win: add uv_gettimeofday()
PR-URL: https://github.com/libuv/libuv/pull/2221
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-03-25 20:23:49 -04:00
Andrew Paprocki
f0ed5df5e8
test: remove call to floor() in test driver
Using `floor()` instead of integer division causes the test driver
to require linking against `libm` on Solaris.

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-03-16 13:22:56 -04:00
Andrew Paprocki
874083d5b3
test: change spawn_stdin_stdout return to void
The return type is changed to avoid having to craft an artificial
`return` just for the Studio compiler.

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-03-16 13:22:56 -04:00
Andrew Paprocki
7f2d5bc32b
test,sunos: test-ipc.c lacks newline at EOF
The Studio compiler issues a warning because the source file lacks a
newline at the end of the file.

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-03-16 13:22:56 -04:00
Andrew Paprocki
53c15c09e4
test,sunos: fix statement not reached warnings
The Studio C compiler issues a warning if there is a `return` after an
`abort()` call or an unreachable `return` after a prior `return`.

The Studio C compiler issues a warning if there is a `return` after a
prior `return`, or an endless loop (e.g., `for (;;)`) with a `return` at
the end of the function.

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-03-16 13:22:16 -04:00
Andrew Paprocki
aa4ff14a5a
test,sunos: use unistd.h code branch
Tests do not compile when selecting the non-`unistd.h` branch.

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-03-16 13:20:48 -04:00
Andrew Paprocki
f62240b2d1
sunos: disable __attribute__((unused))
The Studio compiler prints out a warning when this attribute is used
because it does not support it (at least as of the latest 12.6 version):
https://docs.oracle.com/cd/E77782_01/html/E77788/gjzke.html#scrolltoc

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-03-16 13:20:40 -04:00
Andrew Paprocki
bdf9a96afa
test,sunos: disable UV_DISCONNECT handling
Solaris does not support the non-standard Linux `POLLRDHUP` event, so
disable the code awaiting the disconnects to exit the loop.  Without
this, the `poll_duplex` and `poll_unidirectional` tests will hang and
timeout.

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-03-16 13:20:31 -04:00
Santiago Gimeno
90415a3394
udp: add support for UDP connected sockets
Add two new methods:

`uv_udp_connect()` to connect / disconnect an UDP handle.
`uv_udp_getpeername()` to get the remote peer address of a connected UDP
handle.

Modify `uv_udp_send()` and `uv_udp_try_send()` to accept a `NULL` `addr`
to send messages over an "UDP connection".

Refs: https://github.com/libuv/leps/pull/10
PR-URL: https://github.com/libuv/libuv/pull/1872
Backport-PR-URL: https://github.com/libuv/libuv/pull/2217
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-03-16 12:05:37 -04:00
Santiago Gimeno
03061d54f0
win,udp: allow to use uv_udp_open on bound sockets
PR-URL: https://github.com/libuv/libuv/pull/1872
Backport-PR-URL: https://github.com/libuv/libuv/pull/2217
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-03-16 12:05:32 -04:00
Anna Henningsen
bdb5838eac
unix, win: make fs-poll close wait for resource cleanup
Wait until all fs requests spawned by an `uv_fs_poll_t`
have finished and all timers created by it have fully been
closed before calling the close callback.

Fixes: https://github.com/libuv/libuv/issues/1869
PR-URL: https://github.com/libuv/libuv/pull/1875
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-03-11 09:50:01 +00:00
Ben Noordhuis
cdee607d48 test: relax uv_hrtime() test assumptions
Expecting `uv_sleep(45)` to wake up within 80 ms is not a reasonable
assumption: the operating system may not reschedule the process within
that time frame when the system is overloaded.

The test fails intermittently on our own CI and packagers have reported
similar failures.

Fixes: https://github.com/libuv/libuv/issues/2117
PR-URL: https://github.com/libuv/libuv/pull/2186
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2019-02-21 13:02:44 +01:00
Ben Noordhuis
19d8eb0c92 linux: use statx() to obtain file birth time
Kernels > 4.11 support the statx() system call that lets one retrieve
the birth time of a file. Teach libuv about it.

Fixes: https://github.com/libuv/libuv/issues/2152
PR-URL: https://github.com/libuv/libuv/pull/2184
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2019-02-12 11:16:44 +01:00
erw7
7ed1eced31
win: fix duplicate tty vt100 fn key
Refs: https://github.com/libuv/libuv/pull/2114
Refs: https://github.com/nodejs/node/issues/25875
Refs: https://github.com/nodejs/node/issues/26013
Fixes: https://github.com/libuv/libuv/issues/2168
PR-URL: https://github.com/libuv/libuv/pull/2160
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-02-10 10:04:18 -05:00
Anna Henningsen
0eca049a9b
thread: allow specifying stack size for new thread
PR-URL: https://github.com/libuv/libuv/pull/2179
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2019-02-08 21:15:01 +01:00
cjihrig
8865e72e25
src,include: define UV_MAXHOSTNAMESIZE
This commit adds UV_MAXHOSTNAMESIZE for working with
uv_os_gethostname(). Prior to this commit, this logic was
duplicated in several places across libuv and Node.js alone.

PR-URL: https://github.com/libuv/libuv/pull/2175
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-02-05 08:46:28 -05:00
Santiago Gimeno
6140507ba7
unix,stream: fix zero byte writes
Fixes a regression where a write request to write a zero byte buffer
would never complete.

Refs: https://github.com/libuv/libuv/pull/2097
Refs: https://github.com/libuv/libuv/issues/2134
PR-URL: https://github.com/libuv/libuv/pull/2149
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-01-17 10:07:14 +01:00
Refael Ackermann
37da57b695
win,test: de-flake fs_event_watch_dir_short_path
New versions of Windows ship with 8.3 short-names disabled.
This commit adds 8.3 detection logic in the
fs_event_watch_dir_short_path test.

PR-URL: https://github.com/libuv/libuv/pull/2103
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-01-15 10:25:18 -05:00
Santiago Gimeno
1698be7205
test: fix test-ipc tests
A couple of ipc tests failures where undercover by the previous commit.

- In `ipc-heavy-traffic-deadlock-bug`, `uv_shutdown` can fail with
  `UV_ENOTCONN`. Allow it.
- `ipc_closed_handle` was failing consistently on `Centos6` because the
  first large write was completed in just one syscall. Also, there were
  issues with the lifetime of the `uv_write_t` requests. Refactor the
  test so it passes consistently on `Centos6` while fixing the
  `uv_write_t` issues.

PR-URL: https://github.com/libuv/libuv/pull/2108
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-01-15 09:49:33 +01:00
Santiago Gimeno
0c9586a63f
test: fix test-ipc spawn_helper exit_cb
Make sure an ipc test fails if `term_signal` is not zero. This can
happen on failing assertions in the child process.

PR-URL: https://github.com/libuv/libuv/pull/2108
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-01-15 09:49:02 +01:00
cjihrig
d4288bbeab
unix,win: add uv_os_uname()
Fixes: https://github.com/libuv/libuv/issues/2126
PR-URL: https://github.com/libuv/libuv/pull/2128
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-01-14 10:47:20 -05:00
Jameson Nash
2d2af382ce fsevents: really watch files with fsevents on macos 10.7+
In the original PR, the ifdef conditional was reversed,
leading to the old code-path still being used.
This also reduces some of the redundancy in the conditional checks,
by factoring out the common test.
And fixes a divergence in functionality kFSEventsRenamed =>
kFSEventStreamEventFlagItemRenamed
And actually includes the part of the original PR to kqueue that enabled
watching files with fsevents!

Fixes: https://github.com/libuv/libuv/pull/387
PR-URL: https://github.com/libuv/libuv/pull/2082
Refs: https://github.com/libuv/libuv/pull/1572
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-01-04 13:14:10 -05:00
Ben Noordhuis
c560cf931c unix: don't send handle twice on partial write
Guard against sending the handle over the UNIX domain socket twice
when the first sendmsg() didn't write all bytes.

The changes to src/win partially undo changes made earlier this year,
see the referenced pull request for details.

Libuv never made promises about the value of `req->send_handle` at
different points in time so this should be a safe, non-breaking change.

No tests because this particular condition is hard to hit reliably
across platforms. I spent a lot of time trying to write one but it
turned out hideously complex, and worse, flaky.

Fixes: https://github.com/libuv/libuv/issues/2086
PR-URL: https://github.com/libuv/libuv/pull/2097
Refs: https://github.com/libuv/libuv/pull/1843
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-12-30 20:13:48 +01:00
Joran Dirk Greef
7a2c889fa8 win: fs: fix FILE_FLAG_NO_BUFFERING for writes
On Windows, `fs__open()` maps `UV_FS_O_DIRECT` to
`FILE_FLAG_NO_BUFFERING`.

When `access` is only `FILE_GENERIC_READ` this succeeds, but when
`access` is `FILE_GENERIC_WRITE` this returns an error:

```
0x00000057, ERROR_INVALID_PARAMETER, The parameter is incorrect.
```

The reason is that `FILE_GENERIC_WRITE` includes `FILE_APPEND_DATA`,
but `FILE_APPEND_DATA` and `FILE_FLAG_NO_BUFFERING` are mutually
exclusive:

```
FILE_GENERIC_WRITE = STANDARD_RIGHTS_WRITE |
                     FILE_WRITE_DATA |
                     FILE_WRITE_ATTRIBUTES |
                     FILE_WRITE_EA |
                     FILE_APPEND_DATA |
                     SYNCHRONIZE
```

This incompatibility between access and attribute flags does not appear
to be documented by Microsoft for `FILE_FLAG_NO_BUFFERING` but it is
indirectly documented under [NtCreateFile](https://bit.ly/2rm5wRT):

```
FILE_NO_INTERMEDIATE_BUFFERING
The file cannot be cached or buffered in a driver's internal buffers.
This flag is incompatible with the DesiredAccess FILE_APPEND_DATA flag.
```

The solution is to remove `FILE_APPEND_DATA` from the access flags when
`FILE_FLAG_NO_BUFFERING` is set. Note that this does not prevent
appends, since `FILE_GENERIC_WRITE` also includes `FILE_WRITE_DATA`,
which in turn allows appends.

PR-URL: https://github.com/libuv/libuv/pull/2102
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2018-12-11 13:42:32 +01:00
Ben Noordhuis
8972e65bf5 unix: harden string copying, introduce strscpy()
Replace calls to strcpy() and strncpy() with the newly introduced
uv__strscpy() function that is meticulous about zero-terminating
the destination buffer.

PR-URL: https://github.com/libuv/libuv/pull/2065
Refs: https://www.kernel.org/doc/htmldocs/kernel-api/API-strscpy.html
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-12-04 17:08:09 +01:00
Ben Noordhuis
fe77e34cff test: add uv_inet_ntop(AF_INET) coverage
Libuv had coverage for the AF_INET6 path but not the AF_INET path.
Now it does.

PR-URL: https://github.com/libuv/libuv/pull/2065
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-12-04 17:07:19 +01:00
Jameson Nash
c5593b51dc warnings: fix code that emits compiler warnings
PR-URL: https://github.com/libuv/libuv/pull/2066
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2018-11-29 11:21:44 -05:00
damon-kwok
2749d0c30d
test: fix platform_output test on cygwin
Fixes: https://github.com/libuv/libuv/issues/2077
PR-URL: https://github.com/libuv/libuv/pull/2081
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-11-20 21:16:18 -05:00
Ben Noordhuis
00c6b1649d darwin: speed up uv_set_process_title()
Libuv loaded and unloaded the Core Services and Application Services for
every call to uv_set_process_title().

Change that to load them on the first call to uv_set_process_title() and
delay unloading until libuv is unloaded.

Speeds up process_title_threadsafe by about 10x on my system.

PR-URL: https://github.com/libuv/libuv/pull/2064
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-11-04 18:37:56 +01:00
Ben Noordhuis
6dd44caa35 unix,win: support IDNA 2008 in uv_getaddrinfo()
Encode domain names before passing them on to the libc resolver.
Some getaddrinfo() implementations support IDNA 2008, some only
IDNA 2003 and some don't support i18n domain names at all.

This is a potential security issue because it means a domain name
might resolve differently depending on the system that libuv is
running on.

Fixes: https://github.com/libuv/libuv/issues/2028
PR-URL: https://github.com/libuv/libuv/pull/2046
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-10-30 20:50:23 +01:00
Ben Noordhuis
143da93e2d test,unix: fix race in test runner
The test runner inserted a 250 ms delay to give helper processes time to
settle. That's intrinsically race-y and caused tests to intermittently
fail on platforms like AIX.

Instead of a fixed delay, pass a file descriptor to the helper process
and wait until it closes the descriptor. That way we know for sure the
process has started.

Incidentally, this change reduces the running time of the test suite
from 112 to 26 seconds on my machine.

Fixes: https://github.com/libuv/libuv/issues/2041
PR-URL: https://github.com/libuv/libuv/pull/2056
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-10-30 20:44:16 +01:00
Ben Noordhuis
7da435aeb7 test: fix test runner execvp async-signal-safety
execvp() is not async-signal-safe, execve() is.

PR-URL: https://github.com/libuv/libuv/pull/2056
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-10-30 20:44:06 +01:00
Ben Noordhuis
c3cbab991b test: fix test runner getenv async-signal-safety
getenv() and atoi() are not safe to call between fork() and execve()
so call them before forking.

PR-URL: https://github.com/libuv/libuv/pull/2056
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-10-30 20:43:25 +01:00
Sakthipriyan Vairamani (thefourtheye)
1dfa88f35b
test: make sure that reading a directory fails
Fixes: https://github.com/libuv/libuv/issues/2026
PR-URL: https://github.com/libuv/libuv/pull/2029
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2018-10-18 10:17:44 +02:00
Carlo Marcelo Arenas Belón
dc2476cd69
test: avoid memory leak for test_output
PR-URL: https://github.com/libuv/libuv/pull/2017
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: John Barboza <jbarboza@ca.ibm.com>
2018-10-11 12:21:04 +02:00
Carlo Marcelo Arenas Belón
672b96fab4
win: remove req.c and other cleanup
PR-URL: https://github.com/libuv/libuv/pull/2018
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-10-08 11:06:15 -04:00