Commit Graph

2957 Commits

Author SHA1 Message Date
Recep ASLANTAS
3fa24a2b70 unix: fix warnings about dollar symbol usage in identifiers 2014-09-17 22:47:28 +02:00
Recep ASLANTAS
94e628faf1 unix: fix warnings when loading functions with dlsym 2014-09-17 22:47:01 +02:00
Michael Hudson-Doyle
861de3d71d linux: try epoll_pwait if epoll_wait is missing
It seems that epoll_wait is implemented in glibc in terms of epoll_pwait and
new architectures (like arm64) do not implement the epoll_wait syscall at all.
So if epoll_wait errors with ENOSYS, just call epoll_pwait.
2014-09-17 00:25:46 +02:00
Saúl Ibarra Corretgé
5ccdfc568d test: add test for closing and recreating default loop 2014-09-15 21:34:09 +02:00
Saúl Ibarra Corretgé
0e5004ba77 windows: properly close the default loop
Also close the IOCP handle for any loop.

Closes #393
2014-09-15 21:34:09 +02:00
Saúl Ibarra Corretgé
f70b3fae8b version: add ability to specify a version suffix 2014-09-11 20:58:41 +02:00
Saúl Ibarra Corretgé
1cc5f179f5 include: cleanup uv.h
Remove comments describing the API which are now part of the
documentation, thus avoiding future comment rot (and removing the
existing part).
2014-09-11 09:38:35 +02:00
Saúl Ibarra Corretgé
95797f48e8 doc: mention API documentation in README 2014-09-11 09:38:35 +02:00
Saúl Ibarra Corretgé
32e2e75f60 doc: add API documentation 2014-09-11 09:38:35 +02:00
Trevor Norris
3d38eae377 test: don't close connection on write error
The echo server shouldn't close the connection when there's an error on
write. Instead simply echo the error message and allow the other side to
close the connection.

Also do a partial revert of 4d905fb where after_shutdown was removed.

Fixes: 4d905fb "test: close stream immediately on error"
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Signed-off-by: Saúl Ibarra Corretgé <saghul@gmail.com>
2014-09-10 22:50:54 +02:00
Saúl Ibarra Corretgé
54ce3f6c8e windows: further simplify the code for timers
- Remove the UV_HANDLE_ACTIVE flag. It's a duplicate from
  UV__HANDLE_ACTIVE, which was used solely on timers and loop watchers.

- Avoid duplicated code when running timers by stopping the handle and
  rearming it with the repeat time, thus having a single place where the
  timers are added and removed to and from the RB tree, respectively.
2014-09-10 09:52:00 +02:00
Fedor Indutny
bbf6a144e1 gyp: remove UNLIMITED_SELECT from dependent define
It isn't really needed here.
2014-09-08 09:10:00 +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