Commit Graph

1805 Commits

Author SHA1 Message Date
Ben Noordhuis
b74b1c4c56 bench: add tcp accept benchmarks 2012-09-17 23:22:04 +02:00
Saúl Ibarra Corretgé
cc1c1912ca unix, windows: add uv_tcp_open and uv_udp_open 2012-09-17 18:09:51 +02:00
Saúl Ibarra Corretgé
c8514b0382 unix, windows: return error if uv_pipe_open fails 2012-09-17 18:09:51 +02:00
Bert Belder
3d9de13f1b darwin: fix build when minimum OS X version is specified
The OS X version was being checked with the __MAC_OS_X_VERSION_MIN_REQUIRED__
macro, but this value doesn't match the actual SDK version when it is
overridden with the -mmacosx-version-min command line switch.
2012-09-14 03:57:46 +02:00
Bert Belder
a28f145269 windows: un-break writable tty handles 2012-09-14 02:46:33 +02:00
Bert Belder
5a2988fc33 windows: remove unnecessary pointer alignment code 2012-09-14 01:48:41 +02:00
Bert Belder
b4a5bfb7e0 windows: style 2012-09-14 01:42:36 +02:00
Andrew Paprocki
900ad30b43 aix: add initial platform support for aix using gcc/gxlc
Adds initial libuv build/platform support for AIX. Builds work using gcc or the
IBM XL C compiler using its gxlc wrapper. Platform support is added for
uv_hrtime, uv_exepath, uv_get_free_memory, uv_get_total_memory, uv_loadavg,
uv_uptime, uv_cpu_info, uv_interface_addresses.
2012-09-14 01:23:28 +02:00
Bert Belder
9aead82537 windows: rename UV_HANDLE_CLOSING to UV__HANDLE_CLOSING 2012-09-13 23:42:07 +02:00
Leonard Hecker
15ba80033a windows: support for NULL as uv_queue_work callback
This will make uv_queue_work consistent with other functions, where it's
possible to omit the callback. I'm pretty sure that this is already
implemented for unix systems, although I didn't test the unix part of
uv_queue_work.
2012-09-13 23:37:37 +02:00
Prancesco Pertugio
1f9bd99531 Add uv_thread_self. 2012-09-13 16:08:07 +02:00
Ben Noordhuis
2b04bc7a74 doc: add note about -D_GNU_SOURCE 2012-09-13 14:13:21 +02:00
Saúl Ibarra Corretgé
b7047d6701 unix: remove __read_mostly macro
It creates trouble with llvm-gcc on OS X.
2012-09-13 01:47:34 +02:00
Fedor Indutny
f8e7513a06 darwin: use FSEvents to watch directory changes 2012-09-12 23:38:57 +02:00
Shigeki Ohtsu
57e6113683 unix: support missing api on NetBSD 2012-09-11 17:23:43 +02:00
Ben Noordhuis
4f5c8da191 unix: reimplement accept() EMFILE trick
Implement a best effort approach to mitigating accept() EMFILE errors.

We have a spare file descriptor stashed away that we close to get below
the EMFILE limit. Next, we accept all pending connections and close them
immediately to signal the clients that we're overloaded - and we are, but
we still keep on trucking.

There is one caveat: it's not reliable in a multi-threaded environment.
The file descriptor limit is per process. Our party trick fails if another
thread opens a file or creates a socket in the time window between us
calling close() and accept().

Fixes #315.
2012-09-10 22:12:30 +02:00
Ben Noordhuis
86cb5203b6 unix: fix EMFILE busy loop
Don't spin in epoll_wait() / kevent() / port_getn() / etc. when we can't
accept() a new connection due to having reached the file descriptor limit.
Pass the error to the connection_cb and let the libuv user deal with it.
2012-09-10 21:47:32 +02:00
Bert Belder
27b11abcc0 unix: mark accept idle handle as internal 2012-09-08 17:52:57 +02:00
Ben Noordhuis
817b6c356b build: make gyp_uv understand '-f ninja' 2012-09-07 15:08:43 +02:00
Ben Noordhuis
3bbe8f9754 Merge branch 'v0.8' 2012-09-04 01:23:18 +02:00
Ben Noordhuis
b101a53e6e sunos: don't set TCP_KEEPALIVE
The system headers advertise the socket option but the actual syscall fails
with ENOPROTOOPT.

Fixes joyent/node#3937.
2012-09-04 01:20:33 +02:00
Bert Belder
032c041790 windows: use UV_HANDLE_READABLE and UV_HANDLE_WRITABLE
These flags supersede UV_HANDLE_EOF and UV_HANDLE_SHUTTING. This patch
also moves a lot of stream related state-checking code to stream.c.
2012-09-03 21:09:40 +02:00
Bert Belder
483043b0e5 windows: map WSAESHUTDOWN to UV_EPIPE 2012-09-03 17:16:21 +02:00
Bert Belder
0bbccbc31d windows: remove the UV_HANDLE_SHUT flag 2012-09-03 15:38:29 +02:00
Ben Noordhuis
ff0a93a04f unix: fix clang -Wlanguage-extension-token warnings 2012-09-01 00:27:57 +02:00
Bert Belder
5eb1d191cc Merge branch 'v0.8' 2012-08-30 17:26:02 +02:00
Bert Belder
24c062cc3e windows: fix memory corruption when closing shared server sockets 2012-08-30 17:25:32 +02:00
Ben Noordhuis
a75e10504f freebsd: fix build breakage introduced in 3b69c0f 2012-08-29 22:27:27 +02:00
Shigeki Ohtsu
09faee40eb windows: fix environment_creation test
abc945bc04 fails environment_creation test
2012-08-29 04:31:25 +02:00
Bert Belder
abc945bc04 windows: make spawn with custom environment work again 2012-08-28 22:33:52 +02:00
Bert Belder
5c674b2889 windows: squelch some warnings related to int64 to int32 conversion 2012-08-28 22:33:52 +02:00
Bert Belder
162e57baa9 windows: map ERROR_DIRECTORY to UV_ENOENT 2012-08-28 21:49:54 +02:00
Bert Belder
621a4e36f7 test: add test for uv_is_active and uv_is_closing 2012-08-27 23:57:48 +02:00
Bert Belder
637be161b3 windows: make active and closing handle state independent 2012-08-27 23:56:35 +02:00
Ben Noordhuis
c77d08eb92 bench: add timed and non-timed udp pummel benchmarks 2012-08-25 22:37:18 +02:00
Ben Noordhuis
a3c6a485c6 Merge branch 'v0.8'
Conflicts:
	include/uv.h
2012-08-25 22:33:17 +02:00
Ben Noordhuis
ad7b48aeec unix: fix memory leak in udp.c
Some memory was leaked when the uv_udp_t handle was closed when there were
in-flight send requests with a heap allocated buffer list.

That doesn't happen much in practice. In the common case (writing < 5 buffers),
the buffer list is stored inside the uv_udp_send_t structure, not allocated on
the heap.
2012-08-25 22:28:52 +02:00
Shigeki Ohtsu
343be71cae windows: remove superfluous uv__handle_start
uv__handle_start was not needed in uv_signal_init
2012-08-25 07:00:21 +02:00
Bert Belder
d62b1ac382 windows: fix the MinGW build 2012-08-23 23:50:03 +02:00
Ben Noordhuis
e89cb907a2 unix: fix aliasing warnings in stream.c 2012-08-23 15:52:39 +02:00
Ben Noordhuis
b81e67a19c unix: fix aliasing warning in udp.c 2012-08-23 15:51:06 +02:00
Ben Noordhuis
0ac2fdc554 unix: map errno ESPIPE 2012-08-23 00:32:56 +02:00
Bert Belder
a787a16ac3 unix: fix uv_async_send not working with Sun Studio
uv_async_send would always return 1 when non-gcc compilers were used.
When uv_async_send returns 1 no attempt is made to make port_getn
return, so in this situation uv_async_send didn't wake up the event
loop.
2012-08-22 20:40:14 +02:00
Ben Noordhuis
120e2c1335 darwin: fix return value of uv_sem_init()
It should return 0 or -1, not the kernel status code.
2012-08-22 15:03:26 +02:00
Fedor Indutny
8969df6015 darwin: handle KERN_ABORTED in uv_sem_wait() 2012-08-22 15:01:39 +02:00
Ben Noordhuis
29eb460d0b linux: fix fscanf() -Wunused-result warning 2012-08-22 09:48:02 +02:00
Bert Belder
03bdfd08cc windows: lock tty output before updating the virtual window size 2012-08-22 01:06:05 +02:00
Bert Belder
564e7c765c windows: emit SIGWINCH when the console size changes 2012-08-22 00:43:55 +02:00
Ben Noordhuis
b12b6498d6 darwin, freebsd: use ioctl(FIOCLEX) and ioctl(FIONBIO)
Set the non-blocking and close-on-exec flags with ioctl() instead of fcntl(),
it's about 10-25% faster.

Stick with fcntl() on Solaris. ioctl(FIONBIO) works but is twice as slow as
fcntl(O_NONBLOCK). ioctl(FIOCLEX) doesn't raise an error but doesn't actually
work either.
2012-08-21 23:21:37 +02:00
Bert Belder
37173f8515 Merge branch 'v0.8' 2012-08-21 01:20:05 +02:00