Browse Source

deps: update libuv to 1.2.1

PR: https://github.com/iojs/io.js/pull/423
Reviewed-by: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-by: Bert Belder <bertbelder@gmail.com>
v1.8.0-commit
Saúl Ibarra Corretgé 10 years ago
committed by Bert Belder
parent
commit
07bd05ba33
  1. 1
      deps/uv/AUTHORS
  2. 30
      deps/uv/ChangeLog
  3. 19
      deps/uv/Makefile.am
  4. 2
      deps/uv/configure.ac
  5. 7
      deps/uv/docs/src/async.rst
  6. 3
      deps/uv/docs/src/pipe.rst
  7. 4
      deps/uv/docs/src/tcp.rst
  8. 7
      deps/uv/docs/src/tty.rst
  9. 2
      deps/uv/docs/src/udp.rst
  10. 2
      deps/uv/include/uv-version.h
  11. 18
      deps/uv/src/unix/freebsd.c
  12. 6
      deps/uv/src/unix/pipe.c
  13. 6
      deps/uv/src/unix/tcp.c
  14. 4
      deps/uv/src/unix/tty.c
  15. 4
      deps/uv/src/unix/udp.c
  16. 4
      deps/uv/src/win/internal.h
  17. 18
      deps/uv/src/win/stream.c
  18. 24
      deps/uv/src/win/tcp.c
  19. 15
      deps/uv/src/win/tty.c
  20. 1
      deps/uv/test/test-close-fd.c
  21. 11
      deps/uv/test/test-osx-select.c
  22. 1
      deps/uv/test/test-spawn.c
  23. 12
      deps/uv/test/test-tcp-try-write.c

1
deps/uv/AUTHORS

@ -177,3 +177,4 @@ Logan Rosen <loganrosen@gmail.com>
Kenneth Perry <thothonegan@gmail.com>
John Marino <marino@FreeBSD.org>
Alexey Melnichuk <mimir@newmail.ru>
Johan Bergström <bugs@bergstroem.nu>

30
deps/uv/ChangeLog

@ -1,4 +1,32 @@
2015.01.06, Version 1.2.0 (Stable)
2015.01.15, Version 1.2.1 (Stable), 4ca78e989062a1099dc4b9ad182a98e8374134b1
Changes since version 1.2.0:
* unix: remove unused dtrace file (Saúl Ibarra Corretgé)
* test: skip TTY select test if /dev/tty can't be opened (Saúl Ibarra Corretgé)
* doc: clarify the behavior of uv_tty_init (Saúl Ibarra Corretgé)
* doc: clarify how uv_async_send behaves (Saúl Ibarra Corretgé)
* build: make dist now generates a full tarball (Johan Bergström)
* freebsd: make uv_exepath more resilient (Saúl Ibarra Corretgé)
* unix: make setting the tty mode to the same value a no-op (Saúl Ibarra
Corretgé)
* win,tcp: support uv_try_write (Bert Belder)
* test: enable test-tcp-try-write on windows (Bert Belder)
* win,tty: support uv_try_write (Bert Belder)
* unix: set non-block mode in uv_{pipe,tcp,udp}_open (Ben Noordhuis)
2015.01.06, Version 1.2.0 (Stable), 09f25b13cd149c7981108fc1a75611daf1277f83
Changes since version 1.1.0:

19
deps/uv/Makefile.am

@ -108,7 +108,24 @@ libuv_la_SOURCES += src/unix/async.c \
endif # WINNT
EXTRA_DIST = test/fixtures/empty_file \
test/fixtures/load_error.node
test/fixtures/load_error.node \
include \
test \
docs \
img \
samples \
android-configure \
CONTRIBUTING.md \
LICENSE \
README.md \
checksparse.sh \
vcbuild.bat \
Makefile.mingw \
common.gypi \
gyp_uv.py \
uv.gyp
TESTS = test/run-tests
check_PROGRAMS = test/run-tests

2
deps/uv/configure.ac

@ -13,7 +13,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
AC_PREREQ(2.57)
AC_INIT([libuv], [1.2.0], [https://github.com/libuv/libuv/issues])
AC_INIT([libuv], [1.2.1], [https://github.com/libuv/libuv/issues])
AC_CONFIG_MACRO_DIR([m4])
m4_include([m4/libuv-extra-automake-flags.m4])
m4_include([m4/as_case.m4])

7
deps/uv/docs/src/async.rst

@ -48,9 +48,10 @@ API
.. warning::
libuv will coalesce calls to :c:func:`uv_async_send`, that is, not every call to it will
yield an execution of the callback, the only guarantee is that it will be called at least
once. Thus, calling this function may not wakeup the event loop if it was already called
previously within a short period of time.
yield an execution of the callback. For example: if :c:func:`uv_async_send` is called 5
times in a row before the callback is called, the callback will only be called once. If
:c:func:`uv_async_send` is called again after the callback was called, it will be called
again.
.. seealso::
The :c:type:`uv_handle_t` API functions also apply.

3
deps/uv/docs/src/pipe.rst

@ -38,8 +38,7 @@ API
Open an existing file descriptor or HANDLE as a pipe.
.. note::
The user is responsible for setting the file descriptor in non-blocking mode.
.. versionchanged:: 1.2.1 the file descriptor is set to non-blocking mode.
.. c:function:: int uv_pipe_bind(uv_pipe_t* handle, const char* name)

4
deps/uv/docs/src/tcp.rst

@ -36,9 +36,7 @@ API
Open an existing file descriptor or SOCKET as a TCP handle.
.. note::
The user is responsible for setting the file descriptor in
non-blocking mode.
.. versionchanged:: 1.2.1 the file descriptor is set to non-blocking mode.
.. c:function:: int uv_tcp_nodelay(uv_tcp_t* handle, int enable)

7
deps/uv/docs/src/tty.rst

@ -58,8 +58,13 @@ API
`readable`, specifies if you plan on calling :c:func:`uv_read_start` with
this stream. stdin is readable, stdout is not.
On Unix this function will try to open ``/dev/tty`` and use it if the passed file
descriptor refers to a TTY. This lets libuv put the tty in non-blocking mode
without affecting other processes that share the tty.
.. note::
TTY streams which are not readable have blocking writes.
If opening ``/dev/tty`` fails, libuv falls back to blocking writes for non-readable
TTY streams.
.. c:function:: int uv_tty_set_mode(uv_tty_t*, uv_tty_mode_t mode)

2
deps/uv/docs/src/udp.rst

@ -120,6 +120,8 @@ API
In other words, other datagram-type sockets like raw sockets or netlink
sockets can also be passed to this function.
.. versionchanged:: 1.2.1 the file descriptor is set to non-blocking mode.
.. c:function:: int uv_udp_bind(uv_udp_t* handle, const struct sockaddr* addr, unsigned int flags)
Bind the UDP handle to an IP address and port.

2
deps/uv/include/uv-version.h

@ -32,7 +32,7 @@
#define UV_VERSION_MAJOR 1
#define UV_VERSION_MINOR 2
#define UV_VERSION_PATCH 0
#define UV_VERSION_PATCH 1
#define UV_VERSION_IS_RELEASE 1
#define UV_VERSION_SUFFIX ""

18
deps/uv/src/unix/freebsd.c

@ -75,8 +75,9 @@ uint64_t uv__hrtime(uv_clocktype_t type) {
int uv_exepath(char* buffer, size_t* size) {
char abspath[PATH_MAX * 2 + 1];
int mib[4];
size_t cb;
size_t abspath_size;
if (buffer == NULL || size == NULL || *size == 0)
return -EINVAL;
@ -93,10 +94,19 @@ int uv_exepath(char* buffer, size_t* size) {
mib[3] = -1;
#endif
cb = *size;
if (sysctl(mib, 4, buffer, &cb, NULL, 0))
abspath_size = sizeof abspath;;
if (sysctl(mib, 4, abspath, &abspath_size, NULL, 0))
return -errno;
*size = strlen(buffer);
assert(abspath_size > 0);
abspath_size -= 1;
*size -= 1;
if (*size > abspath_size)
*size = abspath_size;
memcpy(buffer, abspath, *size);
buffer[*size] = '\0';
return 0;
}

6
deps/uv/src/unix/pipe.c

@ -125,9 +125,13 @@ void uv__pipe_close(uv_pipe_t* handle) {
int uv_pipe_open(uv_pipe_t* handle, uv_file fd) {
#if defined(__APPLE__)
int err;
err = uv__nonblock(fd, 1);
if (err)
return err;
#if defined(__APPLE__)
err = uv__stream_try_select((uv_stream_t*) handle, &fd);
if (err)
return err;

6
deps/uv/src/unix/tcp.c

@ -156,6 +156,12 @@ int uv__tcp_connect(uv_connect_t* req,
int uv_tcp_open(uv_tcp_t* handle, uv_os_sock_t sock) {
int err;
err = uv__nonblock(sock, 1);
if (err)
return err;
return uv__stream_open((uv_stream_t*)handle,
sock,
UV_STREAM_READABLE | UV_STREAM_WRITABLE);

4
deps/uv/src/unix/tty.c

@ -108,8 +108,10 @@ int uv_tty_set_mode(uv_tty_t* tty, uv_tty_mode_t mode) {
struct termios tmp;
int fd;
fd = uv__stream_fd(tty);
if (tty->mode == (int) mode)
return 0;
fd = uv__stream_fd(tty);
if (tty->mode == UV_TTY_MODE_NORMAL && mode != UV_TTY_MODE_NORMAL) {
if (tcgetattr(fd, &tty->orig_termios))
return -errno;

4
deps/uv/src/unix/udp.c

@ -565,6 +565,10 @@ int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock) {
if (handle->io_watcher.fd != -1)
return -EALREADY; /* FIXME(bnoordhuis) Should be -EBUSY. */
err = uv__nonblock(sock, 1);
if (err)
return err;
err = uv__set_reuse(sock);
if (err)
return err;

4
deps/uv/src/win/internal.h

@ -136,6 +136,8 @@ int uv_tcp_read_start(uv_tcp_t* handle, uv_alloc_cb alloc_cb,
uv_read_cb read_cb);
int uv_tcp_write(uv_loop_t* loop, uv_write_t* req, uv_tcp_t* handle,
const uv_buf_t bufs[], unsigned int nbufs, uv_write_cb cb);
int uv__tcp_try_write(uv_tcp_t* handle, const uv_buf_t bufs[],
unsigned int nbufs);
void uv_process_tcp_read_req(uv_loop_t* loop, uv_tcp_t* handle, uv_req_t* req);
void uv_process_tcp_write_req(uv_loop_t* loop, uv_tcp_t* handle,
@ -211,6 +213,8 @@ int uv_tty_read_start(uv_tty_t* handle, uv_alloc_cb alloc_cb,
int uv_tty_read_stop(uv_tty_t* handle);
int uv_tty_write(uv_loop_t* loop, uv_write_t* req, uv_tty_t* handle,
const uv_buf_t bufs[], unsigned int nbufs, uv_write_cb cb);
int uv__tty_try_write(uv_tty_t* handle, const uv_buf_t bufs[],
unsigned int nbufs);
void uv_tty_close(uv_tty_t* handle);
void uv_process_tty_read_req(uv_loop_t* loop, uv_tty_t* handle,

18
deps/uv/src/win/stream.c

@ -184,8 +184,22 @@ int uv_write2(uv_write_t* req,
int uv_try_write(uv_stream_t* stream,
const uv_buf_t bufs[],
unsigned int nbufs) {
/* NOTE: Won't work with overlapped writes */
return UV_ENOSYS;
if (stream->flags & UV__HANDLE_CLOSING)
return UV_EBADF;
if (!(stream->flags & UV_HANDLE_WRITABLE))
return UV_EPIPE;
switch (stream->type) {
case UV_TCP:
return uv__tcp_try_write((uv_tcp_t*) stream, bufs, nbufs);
case UV_TTY:
return uv__tty_try_write((uv_tty_t*) stream, bufs, nbufs);
case UV_NAMED_PIPE:
return UV_EAGAIN;
default:
assert(0);
return UV_ENOSYS;
}
}

24
deps/uv/src/win/tcp.c

@ -876,6 +876,30 @@ int uv_tcp_write(uv_loop_t* loop,
}
int uv__tcp_try_write(uv_tcp_t* handle,
const uv_buf_t bufs[],
unsigned int nbufs) {
int result;
DWORD bytes;
if (handle->write_reqs_pending > 0)
return UV_EAGAIN;
result = WSASend(handle->socket,
(WSABUF*) bufs,
nbufs,
&bytes,
0,
NULL,
NULL);
if (result == SOCKET_ERROR)
return uv_translate_sys_error(WSAGetLastError());
else
return bytes;
}
void uv_process_tcp_read_req(uv_loop_t* loop, uv_tcp_t* handle,
uv_req_t* req) {
DWORD bytes, flags, err;

15
deps/uv/src/win/tty.c

@ -1878,6 +1878,21 @@ int uv_tty_write(uv_loop_t* loop,
}
int uv__tty_try_write(uv_tty_t* handle,
const uv_buf_t bufs[],
unsigned int nbufs) {
DWORD error;
if (handle->write_reqs_pending > 0)
return UV_EAGAIN;
if (uv_tty_write_bufs(handle, bufs, nbufs, &error))
return uv_translate_sys_error(error);
return uv__count_bufs(bufs, nbufs);
}
void uv_process_tty_write_req(uv_loop_t* loop, uv_tty_t* handle,
uv_write_t* req) {
int err;

1
deps/uv/test/test-close-fd.c

@ -54,7 +54,6 @@ TEST_IMPL(close_fd) {
int fd[2];
ASSERT(0 == pipe(fd));
ASSERT(0 == fcntl(fd[0], F_SETFL, O_NONBLOCK));
ASSERT(0 == uv_pipe_init(uv_default_loop(), &pipe_handle, 0));
ASSERT(0 == uv_pipe_open(&pipe_handle, fd[0]));
fd[0] = -1; /* uv_pipe_open() takes ownership of the file descriptor. */

11
deps/uv/test/test-osx-select.c

@ -54,8 +54,10 @@ TEST_IMPL(osx_select) {
uv_tty_t tty;
fd = open("/dev/tty", O_RDONLY);
ASSERT(fd >= 0);
if (fd < 0) {
LOGF("Cannot open /dev/tty as read-only: %s\n", strerror(errno));
return TEST_SKIP;
}
r = uv_tty_init(uv_default_loop(), &tty, fd, 1);
ASSERT(r == 0);
@ -104,7 +106,10 @@ TEST_IMPL(osx_select_many_fds) {
}
fd = open("/dev/tty", O_RDONLY);
ASSERT(fd >= 0);
if (fd < 0) {
LOGF("Cannot open /dev/tty as read-only: %s\n", strerror(errno));
return TEST_SKIP;
}
r = uv_tty_init(uv_default_loop(), &tty, fd, 1);
ASSERT(r == 0);

1
deps/uv/test/test-spawn.c

@ -1243,7 +1243,6 @@ TEST_IMPL(closed_fd_events) {
/* create a pipe and share it with a child process */
ASSERT(0 == pipe(fd));
ASSERT(0 == fcntl(fd[0], F_SETFL, O_NONBLOCK));
/* spawn_helper4 blocks indefinitely. */
init_process_options("spawn_helper4", exit_cb);

12
deps/uv/test/test-tcp-try-write.c

@ -28,16 +28,6 @@
#define MAX_BYTES 1024 * 1024
#ifdef _WIN32
TEST_IMPL(tcp_try_write) {
MAKE_VALGRIND_HAPPY();
return 0;
}
#else /* !_WIN32 */
static uv_tcp_t server;
static uv_tcp_t client;
static uv_tcp_t incoming;
@ -138,5 +128,3 @@ TEST_IMPL(tcp_try_write) {
MAKE_VALGRIND_HAPPY();
return 0;
}
#endif /* !_WIN32 */

Loading…
Cancel
Save