Commit Graph

4148 Commits

Author SHA1 Message Date
Fedor Indutny
c60d6af011 darwin: allocate enough space for select() hack
`fd_set`s are way too small for `select()` hack when stream's fd is
bigger than 1023. Make `fd_set`s a part of `uv__stream_select_t`
structure.

fix #1461

Conflicts:
	src/unix/stream.c
2014-09-08 09:09:21 +01:00
Fedor Indutny
145b76b894 darwin: allocate enough space for select() hack
`fd_set`s are way too small for `select()` hack when stream's fd is
bigger than 1023. Make `fd_set`s a part of `uv__stream_select_t`
structure.

fix #1461
2014-09-08 08:37:36 +01:00
Saúl Ibarra Corretgé
7ff52b836d unix, windows: don't allow a NULL callback on timers 2014-09-05 16:59:18 +02:00
Saúl Ibarra Corretgé
fb93ea4f17 windows: simplify code in uv_timer_again
Remove duplicated code by directly calling uv_timer_stop
2014-09-05 16:59:18 +02:00
Saúl Ibarra Corretgé
1afdd9a1e5 test: use less requests on tcp-write-queue-order
Makes the test reliably pass on Windows, otherwise the runtime aborts.
2014-09-04 18:45:39 +02:00
Saúl Ibarra Corretgé
38cc2e39d0 unix: stop child process watcher after last one exits 2014-09-04 10:06:52 +02:00
Saúl Ibarra Corretgé
2d5eaea1cd unix: simplify how process handle queue is managed 2014-09-04 10:06:52 +02:00
mattn
ae6197d730 windows: remove duplicated field
Fixes build
2014-09-03 18:42:46 +02:00
Saúl Ibarra Corretgé
06f9e1438e core: add a reserved field to uv_handle_t and uv_req_t
Just in case we need to work hard in keeping ABI compatibility.
2014-08-29 13:27:53 +02:00
Saúl Ibarra Corretgé
49ec7ca213 doc: update README with versioning information 2014-08-29 10:32:16 +02:00
Saúl Ibarra Corretgé
e524f89beb core: update version to 1.0.0 2014-08-29 10:31:50 +02:00
Bert Belder
6941cab549 windows: fix buffer leak after failed udp send
Fixes #1426

Signed-off-by: Saúl Ibarra Corretgé <saghul@gmail.com>
2014-08-28 08:41:43 +02:00
Saúl Ibarra Corretgé
fabafd6236 windows: make sure sockets and handles are reset on close
Set the socket to INVALID_SOCKET foir TCP and UDP handles and
the handle to INVALID_HANDLE_VALUE on TTY handles after closing them.
2014-08-27 10:53:40 +02:00
Saúl Ibarra Corretgé
4ca9a36389 unix, windows: add uv_fileno
Returns the platform specific file descriptor for handles that are
backed by one. The datatype is abstracted as uv_os_fd_t, which maps to
int on Unices and HANDLE on Windows.

Users can use this function to set specific socket options, for example,
in a non portable way.

This function is essentially a shotgun, you better be careful with
whatever you do with it, don't blame me if you used it to get the fd of
a stream, close it yourself and expect things to Just Work.
2014-08-27 10:53:40 +02:00
Saúl Ibarra Corretgé
bd0692e65a build: use same CFLAGS in autotools build as in gyp
Closes #1362
2014-08-24 15:19:26 +02:00
Saúl Ibarra Corretgé
394d2188ba build: remove unneeded define in uv.gyp
It's a leftover from the days libuv bundled c-ares.
2014-08-24 15:10:12 +02:00
Saúl Ibarra Corretgé
2f83613023 test: fix watcher_cross_stop on Windows
All send callbacks are not necessarily called on the same loop iteration
as the data is received.
2014-08-21 23:34:51 +02:00
Saúl Ibarra Corretgé
a87619ce63 unix, windows: move includes for EAI constants 2014-08-21 21:31:02 +02:00
Saúl Ibarra Corretgé
76cd67686c unix: fix exposing EAI_* glibc-isms 2014-08-21 16:48:45 +02:00
Andrius Bentkus
d5e6f4372f unix: fix tcp write after bad connect freezing
If the connect wouldn't go off (no such tcp remote or any other failure),
the subsequent writes made would not be called. Now we call the writes
in the queue with ECANCELED if the connect fails.

Fix #1432
2014-08-21 16:23:43 +02:00
Timothy J Fontaine
a4f03504ce Now working on v0.11.30 2014-08-19 11:03:54 -04:00
Timothy J Fontaine
35451fed83 2014.08.20, Version 0.11.29 (Unstable)
Changes since version 0.11.28:

* windows: make uv_read_stop immediately stop reading (Jameson Nash)

* windows: fix uv__getaddrinfo_translate_error (Alexis Campailla)

* netbsd: fix build (Saúl Ibarra Corretgé)

* unix, windows: add uv_recv_buffer_size and uv_send_buffer_size
  (Andrius Bentkus)

* windows: add support for UNC paths on uv_spawn (Paul Goldsmith)

* windows: replace use of inet_addr with uv_inet_pton (Saúl Ibarra
  Corretgé)

* unix: replace some asserts with returning errors (Andrius Bentkus)

* windows: use OpenBSD implementation for uv_fs_mkdtemp (Pavel Platto)

* windows: fix GetNameInfoW error handling (Alexis Campailla)

* fs: introduce uv_readdir_next() and report types (Fedor Indutny)

* fs: extend reported types in uv_fs_readdir_next (Saúl Ibarra Corretgé)

* unix: read on stream even when UV__POLLHUP set. (Julien Gilli)
2014-08-19 11:03:51 -04:00
Julien Gilli
1552184238 unix: read on stream even when UV__POLLHUP set.
This fixes a SmartOS specific issue that happens when reading from
a stream that is the reading end of a pipe that has been closed by
the parent process.

In this case, a UV__POLLHUP event would be set on the stream and would
prevent the event loop from closing it. As a result, the event loop
would think there are stil handles open, and leave the process
hanging.

Fixes #1419.
2014-08-18 09:06:27 -07:00
Saúl Ibarra Corretgé
fdbc8567af unix: fix colliding flag value
Fixes #1425
2014-08-18 10:14:21 +02:00
Saúl Ibarra Corretgé
df8ab507a0 fs: extend reported types in uv_fs_readdir_next
Support all possible types on Unix, and files, directories and links on
Windows. Some systems (hello SunOS!) don't have the d_type field on struct
dirent, so mark them as UV_DIRENT_UNKNOWN.
2014-08-15 16:44:44 +02:00
Fedor Indutny
ab2c4425a5 fs: introduce uv_readdir_next() and report types
Introduce:

    int uv_fs_readdir_next(uv_fs_t* req, uv_dirent_t* ent);

`uv_fs_readdir()` is not returning a file names list in `req->ptr`
anymore, the proper way to gather them is to call `uv_fs_readdir_next()`
in a callback.
2014-08-14 17:19:45 +04:00
Alexis Campailla
7bdcf3dc7e windows: fix GetNameInfoW error handling
GetNameInfoW return non-zero on error, and not vice versa.
2014-08-12 17:42:34 +02:00
Pavel Platto
a669f21bf8 windows: use OpenBSD implementation for uv_fs_mkdtemp 2014-08-12 10:04:09 +02:00
Andrius Bentkus
875814adc5 unix: replace some asserts with returning errors 2014-08-11 18:42:48 +02:00
Saúl Ibarra Corretgé
b53aeb491a windows: replace use of inet_addr with uv_inet_pton
Fixes a compilation warning with Visual Studio 2013.
2014-08-11 09:52:48 +02:00
Leonard Hecker
4c90cc8e14 unix: fix typedef of uv_buf_t
Typedefs of unnamed structs cannot be forward declared.
Giving the uv_buf_t struct a name makes forward declarations possible.
2014-08-10 17:30:13 +02:00
huxingyi
ca4741b4a5 windows: fix build on MinGW 2014-08-10 12:09:04 +02:00
Saúl Ibarra Corretgé
09cb5b534e test: fix spawn_reads_child_path when using autoconf
Don't hardcode the name of the executable, take it from the exepath.

Fixes #1407
2014-08-10 11:25:28 +02:00
Saúl Ibarra Corretgé
84ed98e88e test: skip UDP dualstack test on BSDs
As of right now Linux comes with bindv6only=0 by default but BSDs use
bindv6only=1. It can be changed systemwide with sysctl, but it's not
nice to depend on the environment for running tests, so disable it just
on BSDs.
2014-08-10 11:04:42 +02:00
Saúl Ibarra Corretgé
94c7a13f0a test: fix udp_multicast_interface6 on FreeBSD 2014-08-10 10:39:58 +02:00
Paul Goldsmith
ac879ed8f8 windows: add support for UNC paths on uv_spawn 2014-08-10 10:14:42 +02:00
Andrius Bentkus
0ecee213ea unix, windows: add uv_recv_buffer_size and uv_send_buffer_size 2014-08-09 11:36:35 +02:00
Saúl Ibarra Corretgé
4dc0d81ccb netbsd: fix build
Thanks @ezra1!

Closes #1391
2014-08-09 11:22:41 +02:00
Alexis Campailla
c87c44fff3 windows: fix uv__getaddrinfo_translate_error
Use Windows socket error codes, as recommended by MSDN, like we already
do with GetNameInfoW.
2014-08-09 11:18:26 +02:00
Jameson Nash
837c62c71b windows: make uv_read_stop immediately stop reading
This implements locking around the blocking call to ReadFile to get
around a Windows kernel bug where a blocking ReadFile operation on a
stream can deadlock the thread. This allows uv_read_stop to immediately
cancel a pending IO operation, and allows uv_pipe_getsockname to
"pause" any pending read (from libuv) while it retrieves the
sockname information.

If unsupported by the OS (pre-Vista), this reverts to the old
(e.g. deadlock-prone) behavior

Closes #1313
2014-08-09 11:10:57 +02:00
Saúl Ibarra Corretgé
02e1ebd40b include: remove unneeded EADDRINFO errno
EADDRINFO is not a readl errno, it was used to signal any error that
getaddrinfo would return, but we return actual errors now.
2014-08-07 21:24:55 +02:00
Saúl Ibarra Corretgé
a9a4872c29 Now working on v0.11.29 2014-08-07 12:21:41 +02:00
Saúl Ibarra Corretgé
fc9e2a0bc4 2014.08.08, Version 0.11.28 (Unstable)
Changes since version 0.11.27:

* unix, windows: const-ify handle in uv_udp_getsockname (Rasmus
  Pedersen)

* windows: use UV_ECANCELED for aborted TCP writes (Saúl Ibarra
  Corretgé)

* windows: add more required environment variables (Jameson Nash)

* windows: sort environment variables before calling CreateProcess
  (Jameson Nash)

* unix, windows: move uv_loop_close out of assert (John Firebaugh)

* windows: fix buffer overflow on uv__getnameinfo_work() (lilohuang)

* windows: add uv_backend_timeout (Jameson Nash)

* test: disable tcp_close_accept on Windows (Saúl Ibarra Corretgé)

* windows: read the PATH env var of the child (Alex Crichton)

* include: avoid using C++ 'template' reserved word (Iñaki Baz Castillo)

* include: fix version number (Saúl Ibarra Corretgé)
2014-08-07 12:18:10 +02:00
Saúl Ibarra Corretgé
6bcb799a0d include: fix version number 2014-08-07 12:17:06 +02:00
Iñaki Baz Castillo
a1ff22cb7e include: avoid using C++ 'template' reserved word
Closes #1394
2014-08-06 12:52:46 +02:00
Alex Crichton
c7e4b31444 windows: read the PATH env var of the child
The unix and windows process implementations diverge in their behavior
when dealing with subprocesses that are spawned with a relative path.
With unix the *child's* PATH environment variable is read, whereas
with windows the *parent's* environment variable is read.

This commit brings the two implementation in line with respect to
their behavior of reading PATH by having both read the *child's* PATH
environment variable. This involves looking into the user-provided
environment on windows and extracting the PATH variable specifically
so it can be inspected later on.
2014-08-06 02:12:44 +02:00
Saúl Ibarra Corretgé
d802486232 test: disable tcp_close_accept on Windows
It always was a Unix only test
2014-08-05 00:14:26 +02:00
Jameson Nash
2e9d86e105 windows: add uv_backend_timeout 2014-08-04 23:18:38 +02:00
lilohuang
89fc7d80c4 windows: fix buffer overflow on uv__getnameinfo_work()
According to
http://msdn.microsoft.com/en-us/library/windows/desktop/ms738531.aspx,
"NodeBufferSize" and "ServiceBufferSize" parameters of GetNameInfoW()
function are expected to represent the number of WCHAR, not the buffer size
of memory layout.
2014-08-04 09:18:51 +02:00
John Firebaugh
2cd91f9768 unix, windows: move uv_loop_close out of assert
Closes #1387
2014-08-02 09:41:09 +02:00