Commit Graph

4148 Commits

Author SHA1 Message Date
Saúl Ibarra Corretgé
3346082132 test: fix tcp_oob occassionally timing out
Patch by @indutny

Fixes: https://github.com/libuv/libuv/issues/258
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-03-27 08:34:49 +01:00
Devchandra Meetei Leishangthem
2eb1c18240 build: add documentation for ninja support
PR-URL: https://github.com/libuv/libuv/pull/290
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-26 15:45:09 +01:00
Saúl Ibarra Corretgé
508cd3c220 doc: clarify that we don't maintain external doc resources
PR-URL: https://github.com/libuv/libuv/pull/284
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-23 10:56:40 +01:00
Saúl Ibarra Corretgé
db39a6ce71 doc: clarify what uv_*_open accepts
Fixes: https://github.com/libuv/libuv/issues/281
PR-URL: https://github.com/libuv/libuv/pull/284
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-23 10:55:38 +01:00
Saúl Ibarra Corretgé
34da61b351 test: fix tty_file, close handle if initialized
If the handle is closed when it wasn't initialized, uv_close will fail.

PR-URL: https://github.com/libuv/libuv/pull/279
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-20 16:13:01 +01:00
Brian Green
12c93608d0 windows: fix handle leak on EMFILE
If CreateFileW succeeds, but _open_osfhandle fails, the handle must be closed.

PR-URL: https://github.com/libuv/libuv/pull/278
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-20 10:09:49 +01:00
Ryan Phillips
3616e61439 unix: reap child on execvp() failure
Reap the forked process when execvp() fails.  Fixes leaking zombie child
processes.

PR-URL: https://github.com/libuv/libuv/pull/274
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-18 17:11:39 +01:00
Kazuho Oku
252f3624c2 include: use extern "c++" for defining C++ code
PR-URL: https://github.com/libuv/libuv/pull/265
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-18 09:40:51 +01:00
Brett Vickers
43ac8e17fe win: remove unnecessary malloc.h #includes
Several windows .c files are including malloc.h unnecessarily.
This commit removes #includes that should have been removed
when we switched over to uv__malloc and uv__free (in commit
c272f1f1bc).

PR-URL: https://github.com/libuv/libuv/pull/270
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-14 12:45:15 +01:00
Steven Kabbes
96814fe606 build: fix cross-compiling for iOS
Previously to build successfully for iOS, you needed to specify OS=mac
at gyp time.  This treats ios and mac as exactly the same.

PR-URL: https://github.com/libuv/libuv/pull/262
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-12 10:43:10 +01:00
Alexis Campailla
c7ebe68fbc win: fix pipe blocking writes
In the code path for pipe blocking writes, WriteFile is already
posting a completion packet to the I/O completion port.
POST_COMPLETION_FOR_REQ was causing the same request to get
returned twice by GetCompletionStatusEx.
Also on the same code path, we were waiting on the wrong event.

PR-URL: https://github.com/libuv/libuv/pull/238
Reviewed-By: Bert Belder <bertbelder@gmail.com>
2015-03-12 09:23:19 +01:00
Ben Noordhuis
fc9e66e555 unix: reject non-tty fds in uv_tty_init()
Reject file descriptors that correspond to regular files or char/block
devices.  Such file descriptors are incompatible with epoll and trigger
a run-time assert.

Fixes: https://github.com/libuv/libuv/issues/255
PR-URL: https://github.com/libuv/libuv/pull/259
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-11 16:45:51 +01:00
Ben Noordhuis
1df46fe478 unix: don't clobber errno in uv_tty_reset_mode()
uv_tty_reset_mode() is designed to be async signal-safe and is therefore
not allowed to clobber errno.

PR-URL: https://github.com/libuv/libuv/pull/259
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-11 16:45:50 +01:00
Ben Noordhuis
25d4abbabb test: use UV_TTY_MODE_* values in tty test
The UV_TTY_MODE_* enumeration values were introduced in commit 025602d
("tty: implement binary I/O terminal mode") but the test was not updated
to use them.  This commit rectifies that.

PR-URL: https://github.com/libuv/libuv/pull/259
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-11 16:45:48 +01:00
Ben Noordhuis
868700952b doc: fix long lines in tty.rst
PR-URL: https://github.com/libuv/libuv/pull/259
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-11 16:45:24 +01:00
Ben Noordhuis
531b08555d test: fix race condition in multithreaded test
The main thread's epilog closed the file descriptor without waiting for
the worker to shut down, making it sporadically fail with a EBADF error.

Fixes: https://github.com/libuv/libuv/issues/248
PR-URL: https://github.com/libuv/libuv/pull/256
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-11 15:42:34 +01:00
Julien Gilli
b27a55c3cc solaris: fix setsockopt for multicast options
On Solaris and derivatives such as SmartOS, the length of socket options
for multicast and ttl options is not always sizeof(char).

This fixes the udp_options and udp_options6 tests.

PR-URL: https://github.com/libuv/libuv/pull/243
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-11 09:02:31 +01:00
Saúl Ibarra Corretgé
ae6b590fef unix: fix compilation on Android
Thanks @julien33 for the patch.

Fixes: https://github.com/libuv/libuv/issues/252
PR-URL: https://github.com/libuv/libuv/pull/253
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-10 13:43:42 +01:00
Ole André Vadla Ravnås
d557ad73e0 darwin: fix size calculation in select() fallback
Apple's `fd_set` stores its bits in an array of 32-bit integers, which
means `FD_ISSET()` may read out of bounds if we allocate storage at
byte granularity. There's also a chance that the `select()` call could
corrupt the heap, although I didn't investigate that.

This issue was discovered by LLVM's AddressSanitizer which caught
`FD_ISSET()` trying to read out of bounds.

PR-URL: https://github.com/libuv/libuv/pull/241
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-05 21:05:00 +01:00
Brett Vickers
c272f1f1bc memory: add uv_replace_allocator
With uv_replace_allocator, it's possible to override the default
memory allocator's malloc and free calls with functions of the user's
choosing. This allows libuv to interoperate with projects requiring a
custom memory allocator.

Internally, all calls to malloc and free have been replaced with
uv__malloc and uv__free, respectively. The uv__malloc and uv__free
functions call malloc and free unless they have been overridden by a
previous call to uv_replace_allocator.

As part of this change, the special aligned memory allocations
performed in src/win/fs-event.c have been replaced with standard
allocations. The 4-byte alignment being requested in this file was
unnecessary, since standard allocators already guarantee at least an
8-byte alignment.

PR-URL: https://github.com/libuv/libuv/pull/231
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-05 20:02:16 +01:00
Ben Noordhuis
5645b2d69f linux: work around epoll bug in kernels 3.10-3.19
Work around a bug in kernels 3.10 to 3.19 where passing a struct that
has the EPOLLWAKEUP flag set generates spurious syslog audit warnings.

A bad check makes the kernel read the events field when it should not
and complain when the process lacks the CAP_BLOCK_SUSPEND capability.

PR-URL: https://github.com/libuv/libuv/pull/245
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-05 19:43:43 +01:00
TomCrypto
073323baca win: name all anonymous structs and unions
All the public structs and unions in the private fields in uv-win.h have
been named and all code accessing them updated, to comply to the C89
spec (which were previously causing warnings with the -pedantic flag).

PR-URL: https://github.com/libuv/libuv/pull/239
Reviewed-By: Andrius Bentkus <andrius.bentkus@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-04 09:35:10 +01:00
Stephen von Takach
5abb33dd7b build: update the location of gyp
Google moved the repository

PR-URL: https://github.com/libuv/libuv/pull/240
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-03 10:13:14 +01:00
Saúl Ibarra Corretgé
8ef34592a9 doc: document uv_getnameinfo_t.{host|service}
Fixes: https://github.com/libuv/libuv/issues/182
PR-URL: https://github.com/libuv/libuv/pull/233
Reviewed-By: Tim Caswell <tim@creationix.com>
2015-03-02 16:53:57 +01:00
Saúl Ibarra Corretgé
3b0998c935 doc: link system and library calls to man pages
PR-URL: https://github.com/libuv/libuv/pull/236
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-02 14:20:51 +01:00
Saúl Ibarra Corretgé
5ba687f422 doc: add Sphinx plugin for generating links to man pages
PR-URL: https://github.com/libuv/libuv/pull/236
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-02 14:20:02 +01:00
Massimiliano Torromeo
fd3cf20a37 unix: fix glibc-2.20+ macro incompatibility
Since glibc-2.20 the _SVID_SOURCE macro is deprecated and the newer
_DEFAULT_SOURCE macro should be used instead.

Fixes: https://github.com/libuv/libuv/issues/173
PR-URL: https://github.com/libuv/libuv/pull/213
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-02-26 21:08:07 +01:00
Michael
57c4342e4f aix: always deregister closing fds from epoll
In debugging test-tls-ocsp-callback.js for the 0.12.0 Node on
AIX we discovered that there was code missing in
uv__platform_invalidate_fd() in aix.c which removes the file
descriptor from the pollset when needed.  We based the
impelementation in aix.c on the unix version in linux-core.cc.
We can see that this issue was addressed for linux in commit
780d8ad.

PR-URL: https://github.com/libuv/libuv/pull/221
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-02-26 11:39:51 +01:00
Andrius Bentkus
901824ba77 doc: clarify that the thread pool primites are not thread safe
PR-URL: https://github.com/libuv/libuv/pull/227
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-02-26 11:35:01 +01:00
Saúl Ibarra Corretgé
04e40c3f24 Add SHA to changelog 2015-02-26 11:20:45 +01:00
Saúl Ibarra Corretgé
1a7391348a 2015.02.27, Version 1.4.2 (Stable)
Changes since version 1.4.1:

* stream: ignore EINVAL for SO_OOBINLINE on OS X (Fedor Indutny)
2015-02-26 11:20:00 +01:00
Fedor Indutny
19d3d506de stream: ignore EINVAL for SO_OOBINLINE on OS X
Calling `setsockopt()` on shutdown fds/stdio will result in EINVAL.
There is not much problem here as the OOB data can't be sent to already
shutdown fds. Just ignore it and go on.

PR-URL: https://github.com/libuv/libuv/pull/228
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Bert Belder <bertbelder@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-02-26 11:18:15 +01:00
Saúl Ibarra Corretgé
4e9d6c8321 Add SHA to changelog 2015-02-24 20:46:19 +01:00
Saúl Ibarra Corretgé
e8e3fc5789 2015.02.25, Version 1.4.1 (Stable)
Changes since version 1.4.0:

* win: don't use inline keyword in thread.c (Ben Noordhuis)

* windows: fix setting dirent types on uv_fs_scandir_next (Saúl Ibarra
  Corretgé)

* unix,windows: make uv_thread_create() return errno (Ben Noordhuis)

* tty: fix build for SmartOS (Julien Gilli)

* unix: fix for uv_async data race (Michael Penick)

* unix, windows: map EHOSTDOWN errno (Ben Noordhuis)

* stream: use SO_OOBINLINE on OS X (Fedor Indutny)
2015-02-24 20:45:46 +01:00
Saúl Ibarra Corretgé
7a3af176bd doc: adjust next version to 1.4.1 2015-02-24 20:44:02 +01:00
Fedor Indutny
e19089f7b1 stream: use SO_OOBINLINE on OS X
In the collaboration with Ben Noordhuis <info@bnoordhuis.nl> and
Saúl Ibarra Corretgé <saghul@gmail.com>.

Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-02-24 22:34:01 +03:00
Ben Noordhuis
3f910a0196 unix, windows: map EHOSTDOWN errno
Fixes: https://github.com/libuv/libuv/issues/195
PR-URL: https://github.com/libuv/libuv/pull/212
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-02-19 15:38:12 +01:00
Michael Penick
4ed237278c unix: fix for uv_async data race
There's a data race in the consuming side of uv_async. The "pending"
flag could be trampled by producing thread causing an async send
event to be missed.

PR-URL: https://github.com/libuv/libuv/pull/189
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-02-18 21:44:37 +01:00
Julien Gilli
672b204799 tty: fix build for SmartOS
On Solaris derivatives, cfmakeraw is not available. Instead, set the
termios flags manually. The set of flags to use so that the behavior of
the terminal is similar to what it is after a call to cfmakeraw was
taken from
http://www.perkin.org.uk/posts/solaris-portability-cfmakeraw.html.

PR-URL: https://github.com/libuv/libuv/pull/210
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-02-19 09:49:12 +01:00
Ben Noordhuis
ff0316813d unix,windows: make uv_thread_create() return errno
Before this commit, UNIX returned -1 on failure.  Windows sometimes
returned a UV_E* error code and sometimes a bogus status code, courtesy
of errno values not mapping to UV_E* error codes on that platform.

PR-URL: https://github.com/libuv/libuv/pull/204
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-02-17 22:25:01 +01:00
Saúl Ibarra Corretgé
3ddfb4a9cc windows: fix setting dirent types on uv_fs_scandir_next
Also make the tests more strict.

PR-URL: https://github.com/libuv/libuv/pull/201
Reviewed-By: Tim Caswell <tim@creationix.com>
Reviewed-By: Bert Belder <bertbelder@gmail.com>
2015-02-12 09:05:48 +01:00
Ben Noordhuis
454688dc61 win: don't use inline keyword in thread.c
The reported bug is arguably a compiler bug - a non-static inline
function should be inlined inside the compilation unit but still
have external linkage - but the abundant use of 'inline' isn't
really necessary in the first place.  Remove it.

Fixes: https://github.com/libuv/libuv/issues/191
PR-URL: https://github.com/libuv/libuv/pull/194
Reviewed-By: Bert Belder <bertbelder@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-02-11 21:36:16 +01:00
Saúl Ibarra Corretgé
fab74591c2 Add SHA to changelog 2015-02-09 21:07:24 +01:00
Saúl Ibarra Corretgé
19fb8a9064 2015.02.10, Version 1.4.0 (Stable)
Changes since version 1.3.0:

* unix: check Android support for pthread_cond_timedwait_monotonic_np
  (Leith Bade)

* test: use modified path in test (cjihrig)

* unix: implement uv_stream_set_blocking() (Ben Noordhuis)
2015-02-09 21:06:37 +01:00
Ben Noordhuis
b36d4ff930 unix: implement uv_stream_set_blocking()
Commit 393c1c5 ("unix: set non-block mode in uv_{pipe,tcp,udp}_open")
causes a regression in the io.js cluster module.

The io.js documentation states that `worker.send()` and `process.send()`
are synchronous but they no longer were after upgrading to libuv v1.2.1.

The reason they are synchronous is because of backpressure - or rather,
lack of backpressure: a slow consumer eventually causes a fast producer
to run out of memory because the backlog of pending messages in the
producer can grow unchecked.

Ergo, implement uv_stream_set_blocking() on UNIX platforms to let io.js
enable the old blocking behavior for pipes again.

Refs: https://github.com/iojs/io.js/issues/760
PR-URL: https://github.com/libuv/libuv/pull/187
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-02-09 13:28:52 +01:00
cjihrig
e5bdea8ed6 test: use modified path in test
The Windows spawn_with_an_odd_path test builds a PATH variable that
starts with ";.;". However, the old path is then used to run the test.
This commit updates the test to use the new path.

PR: https://github.com/libuv/libuv/pull/184
Reviewed-by: Bert Belder <bertbelder@gmail.com>
2015-02-05 22:50:09 +01:00
Leith Bade
3e75042a2b unix: check Android support for pthread_cond_timedwait_monotonic_np
Since API level 21 (Android 5.0) the non-standard pthread function
pthread_cond_timedwait_monotonic_np has been removed in favour of
the standard pthread_cond_timedwait which libuv normally uses on
Linux.

This commit changes the detection of the Android OS to account for
the removal of the function via the #define
HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC which is only present in older
API levels.

Fixes: https://github.com/libuv/libuv/issues/172
PR-URL: https://github.com/libuv/libuv/pull/176
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-02-02 09:39:54 +01:00
Saúl Ibarra Corretgé
5a52cc146e Add SHA to ChangeLog 2015-01-28 21:55:25 +01:00
Saúl Ibarra Corretgé
165685b2a9 2015.01.29, Version 1.3.0 (Stable)
Changes since version 1.2.1:

* unix, windows: set non-block mode in uv_poll_init (Saúl Ibarra
  Corretgé)

* doc: clarify which flags are supported in uv_fs_event_start (Saúl
  Ibarra Corretgé)

* win,unix: move loop functions which have identical implementations
  (Andrius Bentkus)

* doc: explain how the threadpool is allocated (Alex Mo)

* doc: clarify uv_default_loop (Saúl Ibarra Corretgé)

* unix: fix implicit declaration compiler warning (Ben Noordhuis)

* unix: fix long line introduced in commit 94e628fa (Ben Noordhuis)

* unix, win: add synchronous uv_get{addr,name}info (Saúl Ibarra
  Corretgé)

* linux: fix epoll_pwait() regression with < 2.6.19 (Ben Noordhuis)

* build: compile -D_GNU_SOURCE on linux (Ben Noordhuis)

* build: use -fvisibility=hidden in autotools build (Ben Noordhuis)

* fs, pipe: no trailing terminator in exact sized buffers (Andrius
  Bentkus)

* style: rename buf to buffer and len to size for consistency (Andrius
  Bentkus)

* test: fix test-spawn on MinGW32 (Luis Martinez de Bartolome)

* win, pipe: fix assertion when destroying timer (Andrius Bentkus)

* win, unix: add pipe_peername implementation (Andrius Bentkus)
2015-01-28 21:54:27 +01:00
Saúl Ibarra Corretgé
a30021de07 Merge branch 'v0.10' into v1.x
Conflicts:
	ChangeLog
	src/version.c
	test/test-list.h
	test/test-loop-configure.c
	uv.gyp
2015-01-28 21:50:51 +01:00