Commit Graph

1579 Commits

Author SHA1 Message Date
Bert Belder
9a3dff35c0 test: make the test-hrtime less likely to time out 2012-06-14 22:41:41 +02:00
Bert Belder
b1649b6f77 windows: prevent accidental inheritance of sockets pending acceptance 2012-06-14 21:19:04 +02:00
Bert Belder
5d5688f241 unix: always set CLOEXEC flag for child process stdio FDs 2012-06-14 18:29:47 +02:00
Ben Noordhuis
2c983fb994 unix: fix memory leak in libev
Not everything that identifies itself as glibc really is glibc.
2012-06-14 04:03:05 +02:00
Ben Noordhuis
4d7f1e1864 unix: implement uv_disable_stdio_inheritance() 2012-06-14 01:20:49 +02:00
Bert Belder
ade6930241 windows: implement uv_disable_stdio_inheritance 2012-06-14 01:19:52 +02:00
Ben Noordhuis
94cb06fecf unix: make uv__nonblock() EINTR resilient
It's underspecified if and when ioctl(FIONBIO) or fcntl() can return EINTR.
Let's take the safe route.
2012-06-14 01:19:34 +02:00
Ben Noordhuis
b3a97f8981 unix: make uv__cloexec() EINTR resilient
It's somewhat underspecified if and when fcntl() can return EINTR. It never
does on Linux for F_GETFD or F_SETFD but let's not make any assumptions.
2012-06-14 01:19:34 +02:00
Bert Belder
07c6ac2b55 windows: move child stdio buffer ops to a separate file 2012-06-13 19:17:13 +02:00
Bert Belder
9f44b0e393 windows: fix serious typo in init_child_stdio 2012-06-13 01:30:43 +02:00
Ben Noordhuis
95e89c6a0e unix, windows: share uv__handle_init() 2012-06-13 01:28:58 +02:00
Bert Belder
b7e150ee91 windows: uv_kill() should report UV_ESRC when the victim is already dead 2012-06-12 17:00:16 +02:00
Bert Belder
048422d865 windows: fix some comments 2012-06-12 17:00:15 +02:00
Ben Noordhuis
84f0d96ae0 unix: reset error status in uv_dlopen()
Fixes a bug where uv_dlopen() mistakenly reported failure because of previous
errors.
2012-06-12 01:48:21 +02:00
Bert Belder
e0c6114e32 windows: remove run-time RB_INSERT check from release builds 2012-06-11 22:19:24 +02:00
Ben Noordhuis
3b417d10bc linux: add eventfd and eventfd2 syscalls 2012-06-11 04:20:03 +02:00
Ben Noordhuis
78bc0d6134 unix: implement async handles in libuv
Replace libev backed async handles with a pure libuv implementation.
2012-06-11 04:19:31 +02:00
Ben Noordhuis
ddb5f55922 unix: simplify uv__make_pipe() and uv__make_socketpair() 2012-06-11 02:47:39 +02:00
Bert Belder
5c30443555 unix: uv_async handles should not be unref'ed automatically 2012-06-10 02:25:20 +02:00
George Yohng
fbe99743d5 windows: uv_interface_addresses() should not report disconnected adapters 2012-06-09 22:38:15 +02:00
Ben Noordhuis
0ae026dc84 bench: add lots-of-timers benchmark 2012-06-09 18:42:06 +02:00
Maciej Małecki
c92788e503 test: fix test runner progress bar
Make % completed indicator actually show % completed instead of 0 %.
2012-06-09 18:09:26 +02:00
saghul
6a47e3ac7c windows: add missing include for limits.h 2012-06-09 02:51:18 +02:00
Bert Belder
b5a15f5cdf test: fix test-tcp-shutdown-after-write bug
It was calling uv_read_start before the uv_connect call had completed.
Although we want to allow this in the future, right now it's not
supported.
2012-06-08 03:11:53 +02:00
Ben Noordhuis
23b4e38d20 unix: make uv_shutdown() return UV_ENOTCONN
Return UV_ENOTCONN when the stream is not connected, not UV_EINVAL. Aligns
with uv-win.
2012-06-08 02:48:28 +02:00
Ben Noordhuis
dea45940cd unix: fix req cb / close cb invoke delay
Finalization of closed handles and associated requests was sometimes delayed
until an external event (network I/O, timeout, etc.) happened. This commit
addresses that.
2012-06-08 01:37:39 +02:00
Mark Cavage
9cb8bdc74e sunos: uv_interface_addresses needlessly #ifdef'd out 2012-06-07 10:51:45 -07:00
Ben Noordhuis
053d3afcbf Make ngx_queue_foreach() impl more explicit. 2012-06-07 17:00:33 +02:00
Ben Noordhuis
59cda86709 unix, test: make NANOSEC a 64 bits unsigned int
Avoids accidental overflow / truncation when it's used in 32 bits arithmetic.
2012-06-07 17:00:01 +02:00
Shigeki Ohtsu
e2aa39aecf test: change uv_hrtime() test to iterate upto 100 2012-06-07 15:42:35 +02:00
Iñaki Baz Castillo
b47af98e00 test: add tcp 'close on failed connect' test
Demonstrates temporary event loop stall with uv-unix. The issue is that pending
requests aren't processed until the next event (I/O, timeout, etc.) happens.

See #446, #447 and #448.
2012-06-07 00:06:24 +02:00
Ben Noordhuis
649ad50c32 unix: fix event loop stall
Undoes most of the changes made to libev in 7d2ea31 and c9396dd.
2012-06-06 05:12:28 +02:00
Ben Noordhuis
6fe753022f unix, windows: add debug mode handle printer
Debugging tool, prints a list of active/all handles. Not actively exported.
2012-06-06 04:25:12 +02:00
Bert Belder
24f8a53f4c windows: refactor uv_chdir implementation 2012-06-05 18:23:07 +02:00
Bert Belder
a0d2af0fd2 windows: detect when GetCurrentDirectoryW returns more than MAX_PATH chars
This should never happen. However the CRT has a code path to deal
with this situation, so at least detect it when it happens and return
an error, instead of potentially opening a security hole.
2012-06-05 18:23:06 +02:00
Ben Noordhuis
c8c9fe1c74 unix: move memset out of recvmsg inner loop 2012-06-05 15:42:20 +02:00
Ben Noordhuis
738b31eb3a unix: fix loop starvation under high network load
uv__read() and uv__udp_recvmsg() read incoming data in a loop. If data comes
in at high speeds, the kernel receive buffer never drains and said functions
never terminate, stalling the event loop indefinitely. Limit the number of
consecutive reads to 32 to stop that from happening.

The number 32 was chosen at random. Empirically, it seems to maintain a high
throughput while still making the event loop move forward at a reasonable pace.
2012-06-05 15:27:51 +02:00
Bert Belder
be9d1ce909 windows: cast STARTUP_INFO.cbReserved2 to WORD to avoid warnings 2012-06-05 00:58:51 +02:00
Bert Belder
829eaf3e3f windows: cast OVERLAPPED.Internal to NTSTATUS to avoid warnings 2012-06-05 00:58:50 +02:00
Bert Belder
1b75d36bab windows: refactor uv_exepath implementation 2012-06-05 00:58:50 +02:00
Bert Belder
c9f83e524c windows: refactor uv_cwd implementation 2012-06-05 00:58:49 +02:00
Ben Noordhuis
7d2ea31618 unix: fix event loop stall
Stop libev from entering the epoll_wait/kevent/port_getn/etc. syscall when
there are no active handles left, that will block indefinitely.
2012-06-04 23:36:50 +02:00
Bert Belder
0dff0e7d47 test: avoid compiler warnings due to size_t truncation 2012-06-04 18:04:49 +02:00
Bert Belder
64f8cf463d windows, unix: uv_buf_init should take unsigned int for the buffer length 2012-06-04 18:04:49 +02:00
Bert Belder
c0b530d079 Windows: avoid compiler warning 2012-06-04 18:04:48 +02:00
Bert Belder
60746b03cb windows: move some stream functions to stream-inl.h 2012-06-04 18:04:47 +02:00
Bert Belder
754a695df6 windows: move request macros to req-inl.h 2012-06-04 18:04:46 +02:00
Bert Belder
63b9b1d472 windows: move handle macros to handle-inl.h 2012-06-04 18:04:45 +02:00
Bert Belder
1974541bc9 windows: guard against including req-inl.h more than once 2012-06-04 18:04:45 +02:00
Bert Belder
3b907cf0ec windows: guard against including handle-inl.h more than once 2012-06-04 18:04:44 +02:00