Commit Graph

4148 Commits

Author SHA1 Message Date
Jameson Nash
8db42383ad windows: sort environment variables before calling CreateProcess 2014-08-01 09:26:21 +02:00
Jameson Nash
2ce14cfab4 windows: add more required environment variables
Adds more of the undocumented-but-required environment variables for uv_spawn
2014-08-01 09:26:21 +02:00
Saúl Ibarra Corretgé
431b535a51 windows: use UV_ECANCELED for aborted TCP writes
For consistency with Unix
2014-08-01 00:23:51 +02:00
Rasmus Christian Pedersen
e72d48ddab unix, windows: const-ify handle in uv_udp_getsockname 2014-07-31 22:27:36 +02:00
Timothy J Fontaine
ff6a718dfc Now working on v0.11.28 2014-07-31 10:11:03 -07:00
Timothy J Fontaine
ffe24f9550 2014.07.32, Version 0.11.27 (Unstable)
Changes since version 0.11.26:

* unix, windows: use the same threadpool implementation (Saúl Ibarra
  Corretgé)

* unix: use struct sockaddr_storage for target UDP addr (Saúl Ibarra
  Corretgé)

* doc: add documentation to uv_udp_start_recv (Andrius Bentkus)

* common: use common uv__count_bufs code (Andrius Bentkus)

* unix, win: add send_queue_size and send_queue_count to uv_udp_t
  (Andrius Bentkus)

* unix, win: add uv_udp_try_send (Andrius Bentkus)

* unix: return UV_EAGAIN if uv_try_write cannot write any data (Saúl
  Ibarra Corretgé)

* windows: fix compatibility with cygwin pipes (Jameson Nash)

* windows: count queued bytes even if request completed immediately
  (Saúl Ibarra Corretgé)

* windows: disable CRT debug handler on MinGW32 (Saúl Ibarra Corretgé)

* windows: map ERROR_INVALID_DRIVE to UV_ENOENT (Saúl Ibarra Corretgé)

* unix: try to write immediately in uv_udp_send (Saúl Ibarra Corretgé)

* unix: remove incorrect assert (Saúl Ibarra Corretgé)

* openbsd: avoid requiring privileges for uv_resident_set_memory (Aaron
  Bieber)

* unix: guarantee write queue cb execution order in streams (Andrius
  Bentkus)

* img: add logo files (Saúl Ibarra Corretgé)

* aix: improve AIX compatibility (Andrew Low)

* windows: return bind error immediately when implicitly binding (Saúl
  Ibarra Corretgé)

* windows: don't use atexit for cleaning up the threadpool (Saúl Ibarra
  Corretgé)

* windows: destroy work queue elements when colsing a loop (Saúl Ibarra
  Corretgé)

* unix, windows: add uv_fs_mkdtemp (Pavel Platto)

* build: handle platforms without multiprocessing.synchronize (Saúl
  Ibarra Corretgé)

* windows: change GENERIC_ALL to GENERIC_WRITE in fs__create_junction
  (Tony Kelman)

* windows: relay TCP bind errors via ipc (Alexis Campailla)
2014-07-31 10:11:01 -07:00
Timothy J Fontaine
71b7128987 Now working on v0.10.29 2014-07-31 09:29:01 -07:00
Timothy J Fontaine
9c14b616f5 2014.07.32, Version 0.10.28 (Stable)
Changes since version 0.10.27:

* windows: fix handling closed socket while poll handle is closing (Saúl
  Ibarra Corretgé)

* unix: return system error on EAI_SYSTEM (Saúl Ibarra Corretgé)

* unix: fix bogus structure field name (Saúl Ibarra Corretgé)

* darwin: invoke `mach_timebase_info` only once (Fedor Indutny)
2014-07-31 09:28:58 -07:00
Alexis Campailla
6d3a051eb4 windows: relay TCP bind errors via ipc
This is the libuv side of the fix for Node's cluster module on Windows.
https://github.com/joyent/node/issues/7691

Windows and Unix return certain socket errors (i.e. EADDRINUSE) at
different times: bind on Windows, and listen on Unix.
In an effort to hide this difference, libuv on Windows stores such
errors in the bind_error field of uv_tcp_t, to defer raising it at
listen time.
This worked fine except for the case in which a socket is shared in
a Node cluster and a bind error occurs.

A previous attempt to fix this (
d1e6be1460
3da36fe00e
) was flawed becaused in an attempt to relay the error at the JS level
it caused the master to start accepting connections.

With this new approach, libuv itself is relaying the bind errors,
providing for a uniform behavior of uv_tcp_listen.
2014-07-31 17:24:40 +02:00
Tony Kelman
3d73d55627 windows: change GENERIC_ALL to GENERIC_WRITE in fs__create_junction
Fixes #1385

See ReactOS's mklink implementation and
http://stackoverflow.com/a/10508724
2014-07-31 14:39:26 +02:00
Saúl Ibarra Corretgé
c11a598d7c build: handle platforms without multiprocessing.synchronize 2014-07-31 10:12:58 +02:00
Pavel Platto
e99b89f2ad unix, windows: add uv_fs_mkdtemp 2014-07-31 09:43:55 +02:00
Saúl Ibarra Corretgé
beb54fe72d windows: destroy work queue elements when colsing a loop
Destroy the async handle used to notify about work being done, and the
mutex used to protect each loop's work queue.

Closes #1375
2014-07-28 09:40:23 +02:00
Saúl Ibarra Corretgé
c8abb29f68 windows: don't use atexit for cleaning up the threadpool
If libuv is loaded as a DLL and is later unloaded deadlocks can happen
when running atexit handlers, so we can't use synchronization
priomitives or join threads there.

For reference see https://github.com/saghul/pyuv/issues/171
2014-07-28 09:38:57 +02:00
Saúl Ibarra Corretgé
645e2a2855 doc: update link to pyuv in README 2014-07-27 12:33:02 +02:00
Saúl Ibarra Corretgé
1ece8fb85f windows: return bind error immediately when implicitly binding
If a TCP handle is bound automatically when calling uv_listen or
uv_connect, there is a remote possibility that it fails, return
the error if so.
2014-07-25 12:48:16 +02:00
Andrew Low
cdc979dbe0 aix: improve AIX compatibility 2014-07-22 22:57:24 +02:00
Saúl Ibarra Corretgé
06c60e9662 doc: add logo image to README 2014-07-20 19:38:46 +02:00
Saúl Ibarra Corretgé
a499b737bf img: add logo files 2014-07-20 18:24:28 +02:00
Andrius Bentkus
960eefb319 unix: guarantee write queue cb execution order in streams
The problem was that the canceled write callbacks
were being called before the already written callbacks, even
though they were queued after them.
2014-07-18 13:16:10 +02:00
Aaron Bieber
38323c9fbf openbsd: avoid requiring privileges for uv_resident_set_memory 2014-07-16 09:56:34 +02:00
Graham Lee
dc1ea27c73 doc: clarify the return value of uv_default_loop 2014-07-13 11:23:08 +02:00
Saúl Ibarra Corretgé
817c09257d unix: remove incorrect assert
After 41891222bc landed it's possible that uv__udp_sendmsg is called
even if there are no pending write nor write completed requests:

1. User calls uv_udp_send and the request is sent immediately. The
   request is the added to the completed queue and we 'feed' the uv__io
   handle so that we process the completed request in the next
   iteration.
2. User calls uv_udp_send again but the request is not completed
   immediately, so it's queued in the write_queue.
3. The uv__io handle gets a UV__POLLOUT event and uv__udp_sendmsg is
   run, which completes the send request and puts it in the
   write_completed_queue. Afterwards, uv__udp_run_completed is executed
   and the write_completed queue is drained.
4. At this point, the uv__io handle was made pending in step 3, in
   uv__udp_sendmsg, but we no longer have requests to write or to complete,
   so we skip processing.
2014-07-11 22:53:59 +02:00
Saúl Ibarra Corretgé
9e921ed1e5 doc: clarify why we don't use SO_REUSEADDR for TCP on Windows 2014-07-08 18:57:35 +02:00
Saúl Ibarra Corretgé
ad78e456e9 test: fix watcher_cross_stop
It's possible that recv_cb_called is bigger than the number of sockets,
because if all sends succeed the recv callback is called twice: once
with the actual data, and another time with 0.
2014-07-08 18:44:38 +02:00
Saúl Ibarra Corretgé
41891222bc unix: try to write immediately in uv_udp_send 2014-07-08 18:44:38 +02:00
Iñaki Baz Castillo
bf6e90f4d6 doc: cleanup API documentation in uv.h 2014-07-06 22:33:15 +02:00
Saúl Ibarra Corretgé
c44f264641 windows: map ERROR_INVALID_DRIVE to UV_ENOENT 2014-07-06 21:00:59 +02:00
mattn
b17223cd60 build: fix build on MinGW32 2014-07-06 20:40:59 +02:00
Saúl Ibarra Corretgé
636b108d37 windows: disable CRT debug handler on MinGW32
We cannot actually use it because the header is not present, so disable
it. On MinGW-w64 it does work though.
2014-07-06 20:40:59 +02:00
Saúl Ibarra Corretgé
377bf68a2a windows: count queued bytes even if request completed immediately
The send_queue_size/count needs to maintain its value until right before
the callback is called.
2014-07-06 20:10:17 +02:00
Jameson Nash
ebafb90acd windows: fix compatibility with cygwin pipes
This makes libuv more tolerant to the properties of the pipes
that it can use without any issue. This is necessary because Cygwin
(and hence Mintty) opens STDIN without FILE_WRITE_ATTRIBUTES.
2014-07-06 20:05:32 +02:00
Andrius Bentkus
b9b386ac5a doc: grammar, udp documentation fix up 2014-07-05 11:23:48 +02:00
Saúl Ibarra Corretgé
b018dc5b72 test: simplify test-tcp-try-write
Use a smaller buffer thus making sure that uv_try_write will succeed at
least once
2014-07-05 11:06:39 +02:00
Saúl Ibarra Corretgé
40ad12e5be unix: return UV_EAGAIN if uv_try_write cannot write any data 2014-07-04 20:45:09 +02:00
Andrius Bentkus
0d43992c3b unix, win: add uv_udp_try_send
The function returns UV_EAGAIN if the queue is not empty and
the message couldn't be sent immediately.
2014-07-04 18:30:33 +02:00
Andrius Bentkus
b769484ca3 unix, win: add send_queue_size and send_queue_count to uv_udp_t
This functionality is present in stream and uv_udp_t has a queue
as well so it makes sense for udp to have a send_write_size.
Since udp sends entire messages atomically, the send_queue_count field
lets the user determine how many messages are there left to send.
2014-07-04 18:28:18 +02:00
Andrius Bentkus
f63e073be2 common: use common uv__count_bufs code
Until now it was reimplemented in 2 different places (unix, win).
2014-07-04 18:28:18 +02:00
Andrius Bentkus
d17bfc617e doc: add documentation to uv_udp_start_recv 2014-07-02 18:49:06 +02:00
Saúl Ibarra Corretgé
1830a3cd91 Revert "test: make barrier test more rigorous"
This reverts commit 6c6c922167.

It introduced a race condition which made tests fail on Linux and SunOS.

Closes #1340
2014-07-02 00:16:50 +02:00
Saúl Ibarra Corretgé
4bace4d67c unix: use struct sockaddr_storage for target UDP addr 2014-06-29 23:52:46 +02:00
Saúl Ibarra Corretgé
8d11aacb79 unix, windows: use the same threadpool implementation 2014-06-27 14:27:04 +02:00
Caleb James DeLisle
fe8322d27c windows: fix mingw32/debug build
Debug build failed on mingw32 because CRT assertion disable code was stubbed out.
Replace __declspec(thread) with UV_THREAD_LOCAL which is defined as __thread on GCC.
2014-06-27 08:21:27 +02:00
Caleb James DeLisle
d3c30aa276 windows: use '-l<library>' form in gyp file
This fixes the build with MinGW32.
2014-06-27 08:20:41 +02:00
Tim Cooper
546fa7d508 doc: remove duplicate word 2014-06-27 08:16:53 +02:00
Fedor Indutny
4661f2d6c0
Now working on v0.11.27 2014-06-27 04:41:02 +04:00
Fedor Indutny
115281a105
2014.06.28, Version 0.11.26 (Unstable)
Changes since version 0.11.25:

* windows: add VT100 codes ?25l and ?25h (JD Ballard)

* windows: add invert ANSI (7 / 27) emulation (JD Ballard)

* unix: fix handling error on UDP socket creation (Saúl Ibarra Corretgé)

* unix, windows: getnameinfo implementation (Rasmus Pedersen)

* heap: fix `heap_remove()` (Fedor Indutny)

* unix, windows: fix parsing scoped IPv6 addresses (Saúl Ibarra
  Corretgé)

* windows: fix handling closed socket while poll handle is closing (Saúl
  Ibarra Corretgé)

* thread: barrier functions (Ben Noordhuis)

* windows: fix PYTHON environment variable usage (Jay Satiro)

* unix, windows: return system error on EAI_SYSTEM (Saúl Ibarra
  Corretgé)

* windows: fix handling closed socket while poll handle is closing (Saúl
  Ibarra Corretgé)

* unix: don't run i/o callbacks after prepare callbacks (Saúl Ibarra
  Corretgé)

* windows: add tty unicode support for input (Peter Atashian)

* header: introduce `uv_loop_size()` (Andrius Bentkus)

* darwin: invoke `mach_timebase_info` only once (Fedor Indutny)
2014-06-27 04:40:57 +04:00
Saúl Ibarra Corretgé
d4c1228d15 include: const-ify arguments to uv_getnameinfo_cb 2014-06-26 22:46:39 +02:00
Saúl Ibarra Corretgé
570caf04db Merge branch 'v0.10'
Conflicts:
	ChangeLog
	build.mk
	src/unix/darwin.c
	src/unix/getaddrinfo.c
	src/version.c
	test/test-list.h
2014-06-25 10:31:21 +02:00
Fedor Indutny
211bf4ec37 darwin: invoke mach_timebase_info only once
According to @aktau, the call to `mach_timebase_info` costs 90% of the
total execution time of `uv_hrtime()`. The result of the call is static
on all existing platforms, so there is no need in invoking it multiple
times.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-06-25 01:32:05 +04:00