Commit Graph

1839 Commits

Author SHA1 Message Date
Ben Noordhuis
8399cb1fc3 test: fix memory leaks in fs_symlink test 2012-10-01 23:54:34 +02:00
Ben Noordhuis
d36e2f21cf unix: fix buffer overrun in fs.c 2012-10-01 23:50:58 +02:00
Ben Noordhuis
6342658ad8 unix, windows: fix memory leak in fs-poll.c
The internal timer handle associated with the uv_fs_poll_t wasn't always closed
when the fs poll handle was closed, leaking about 650 bytes memory.
2012-10-01 23:43:32 +02:00
Ben Noordhuis
f793298c9e include: remove uv_fs_poll ABI compat padding 2012-10-01 23:43:32 +02:00
Bert Belder
447ee1060c doc: add link to test/ to the readme 2012-10-01 23:07:31 +02:00
Ben Noordhuis
7320633c4b unix: remove uv_fs_stat windows compat hack
uv_fs_stat and uv_fs_lstat removed the trailing backslash (if any) from the path
in order to please a test case that was written for Windows. Remove the
compatibility hack and fix the test.
2012-10-01 22:53:59 +02:00
Ben Noordhuis
678e95a443 test: close handle in ref tests
Everything that gets reported by valgrind now is an actual memory leak.
2012-10-01 22:53:59 +02:00
Ben Noordhuis
b60a24a206 unix: remove libeio 2012-10-01 22:53:59 +02:00
Ben Noordhuis
74999f8f99 unix: port fs and work api to new thread pool 2012-10-01 22:53:59 +02:00
Ben Noordhuis
36c91e3ba0 unix: port getaddrinfo to new thread pool 2012-10-01 22:53:59 +02:00
Ben Noordhuis
f35a4b628a unix: add custom thread pool 2012-10-01 22:53:59 +02:00
Ben Noordhuis
1020a1a82e include: make ngx_queue macros sanitary 2012-10-01 22:53:59 +02:00
Ben Noordhuis
5e09e1b57e linux: please valgrind, free memory at exit
Free the memory that is used to store the new argv and envp. It's not strictly
necessary (the OS is going to reclaim the memory anyway) but it makes the output
from valgrind a lot less noisy.
2012-10-01 22:53:59 +02:00
Ben Noordhuis
45b5e79f8e test: fix memory leak in tcp_ping_pong 2012-10-01 22:53:59 +02:00
Ben Noordhuis
f090297f62 test: delete default loop after test run
Delete the default event loop after the test completes. Keeps valgrind happy.
2012-10-01 22:53:59 +02:00
Ben Noordhuis
4e268f7718 test: add valgrind support
Run tests through valgrind when UV_USE_VALGRIND=1 is set in the environment.
2012-10-01 22:53:59 +02:00
Ben Noordhuis
48f98424bd test: fix error message in runner 2012-10-01 22:53:59 +02:00
Ben Noordhuis
1923abda94 test: add uv_fs_readlink test 2012-10-01 22:53:59 +02:00
Bert Belder
e2cffdcf5f doc: add lxjs talk to readme 2012-10-01 19:49:30 +02:00
Ben Noordhuis
7ac23ee0c6 unix: move getaddrinfo code to getaddrinfo.c 2012-09-28 08:05:53 +02:00
Ben Noordhuis
4f8e2a8e8e unix: close async pipe fds on loop delete 2012-09-28 07:44:40 +02:00
Ben Noordhuis
17ea46d259 include: remove uv_counters_t, missed in 837edf4 2012-09-28 07:44:36 +02:00
Shannen Saez
8afd71a128 windows: fix vcbuild.bat issue
gyp_uv was complaining because it never receives a value for which type
of library to build (static vs shared). This makes vcbuild.bat set the
default to build a static library.
2012-09-26 13:41:19 +02:00
Luigi Grilli
5bfb7c917b windows: build system improvements
* Add shared/static library option
* Add x86/x64 target option
* Improve Visual Studio detection
* Set GYP_MSVS_VERSION to pick VS2010 over VS2008

Closes GH-504
Closes GH-514
2012-09-21 00:53:55 +02:00
Bert Belder
45931f8b2b Add mailing list to readme 2012-09-20 23:50:42 +02:00
Bert Belder
46bd5fb392 Rearrange struct layouts to make FFI bindings easier
This patch ensures that all struct fields are in this order:
  1. public
  2. readonly
  3. private
2012-09-20 16:07:08 +02:00
Fedor Indutny
73cf3600d7 darwin: fsevents: emit UV_CHANGE on metadata change 2012-09-20 13:51:04 +02:00
Charlie McConnell
2916a16067 unix: map EDQUOT to UV_ENOSPC 2012-09-20 00:25:15 +02:00
Ben Noordhuis
ea8db64559 darwin: fix 'directive in macro' compiler warning 2012-09-18 13:14:14 +02:00
Fedor Indutny
778144f0b5 darwin: emit relative path in fsevents 2012-09-18 00:29:29 +02:00
Ben Noordhuis
be2a2176ce unix: rethink relaxed accept() approach
Benchmarks demonstrated that the idle timer handle approach didn't balance the
load quite fair enough, the majority of new connections still ended up in one
or two processes.

The new approach voluntarily gives up a scheduler timeslice by calling
nanosleep() with a one nanosecond timeout.

Why not sched_yield()? Because on Linux (and this is probably true for other
Unices as well), sched_yield() only yields if there are other processes running
on the same CPU.

nanosleep() on the other hand always forces the process to sleep, which gives
other processes a chance to accept our pending connections.
2012-09-18 00:16:43 +02:00
Ben Noordhuis
37dc7472d7 test: fix aliasing warning in dns-server.c 2012-09-17 23:48:19 +02:00
Ben Noordhuis
29f44c7564 bench: let client close connection in tcp_multi_accept{2,4,8} 2012-09-17 23:22:04 +02:00
Ben Noordhuis
a8c6da8dfa bench: add idle delay to tcp_multi_accept{2,4,8} 2012-09-17 23:22:04 +02:00
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