The fields for UV_HANDLE_PRIVATE_FIELDS in uv-win.h and uv-unix.h are
the same, but in different order. Simply swap them so uv_handle_t are
the same on both platforms.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
The PATH-parsing code for windows erroneously contained an infinite
loop when the PATH started with a leading semicolon. Each iteration of
the loop usually bumped over the separator, but if the first character
was a semicolon then it would never skip it, causing the infinite
loop.
Closes#909
Fix https://github.com/joyent/node/issues/7345
Google Chrome is launching native messaging hosts by invoking cmd.exe
with input/output redirected from/to named pipes. The host ends up
with a read-only handle to the stdin pipe. This is causing
SetNamedPipeHandleState to fail.
Reopen one of the pipe descriptors as read/write through the procfs.
Allows us to close the original pipe file descriptors, saving a file
descriptor on kernels that don't support eventfd(2).
Changes since version 0.11.22:
* fs: avoid using readv/writev where possible (Fedor Indutny)
* mingw: fix build with autotools (Saúl Ibarra Corretgé)
* bsd: support IPv6 qualified link-local addresses (Saúl Ibarra Corretgé)
* unix: add UV_HANDLE_IPV6 flag to tcp and udp handles (Saúl Ibarra Corretgé)
* unix, windows: do not set SO_REUSEADDR by default on udp (Saúl Ibarra
Corretgé)
* windows: fix check in uv_tty_endgame() (Maks Naumov)
* unix, windows: add IPv6 support for uv_udp_multicast_interface (Saúl Ibarra
Corretgé)
* unix: fallback to blocking writes if reopening a tty fails (Saúl Ibarra
Corretgé)
* unix: fix handling uv__open_cloexec failure (Saúl Ibarra Corretgé)
* unix, windows: add IPv6 support to uv_udp_set_membership (Saúl Ibarra
Corretgé)
* unix, windows: removed unused status parameter (Saúl Ibarra Corretgé)
* android: add support of ifaddrs in android (Javier Hernández)
* build: fix SunOS and AIX build with autotools (Saúl Ibarra Corretgé)
* build: freebsd link with libelf if dtrace enabled (Saúl Ibarra Corretgé)
* stream: do not leak `alloc_cb` buffers on error (Fedor Indutny)
* unix: fix setting written size on uv_wd (Saúl Ibarra Corretgé)
Signed-off-by: Fedor Indutny <fedor@indutny.com>
The VirtualBox shared file system doesn't seem to be capable of
`readv()` syscall. Since we don't need them in the most of the cases
anyway, it won't hurt to just use `read()` and `write()` when we are
reading just one buffer.
see https://github.com/joyent/node/issues/7343 for details.
Add UV_UDP_REUSEADDR flag instead, which can be passed to uv_udp_bind.
If the udp handle is unbound when uv_udp_set_memberhsip or
uv_udp_set_multicast_interface is called, the handle will be bound with
UV_UDP_REUSEADDR set.
In case reopening the file descriptor fails, fallback to the old
behavior where we do blocking writes, to avoid disrupting other
processes potentially using the file descriptor.
When choosing an IPv6 interface all low level APIs use the interface
index which can be gathered with if_nametoindex. Passing a 0 means to
use the default as per the documentation. On OSX, however, this is not
the case and when 0 is specified it gives EADDRNOTAVAIL error. So, we
workaround the test, by using the 'lo0' interface on OSX, which has an
index of 1.