Commit Graph

2851 Commits

Author SHA1 Message Date
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
Andrius Bentkus
36b38cbdba style: remove trailing whitespace
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-06-24 20:18:10 +04:00
Saúl Ibarra Corretgé
029e1273b8 unix: define NI_MAXHOST and NI_MAXSERV if needed
OSX only exposes them if _POSIX_C_SOURCE is not defined, for instance.
2014-06-24 10:20:43 +02:00
Andrius Bentkus
e392a1af4d header: introduce uv_loop_size()
We add a function called uv_loop_size which returns the size of
the loop. It is an additional function which complements
`uv_handle_size` and` uv_req_size` in order to provide full FFI
support.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-06-24 08:47:17 +04:00
Saúl Ibarra Corretgé
6de622c3e4 build: add missing file to Makefile.mingw 2014-06-23 08:19:29 +02:00
Saúl Ibarra Corretgé
218f48ae56 build: fix compilation warning on MinGW-w64 2014-06-19 23:25:43 +02:00
Peter Atashian
68cd6d6a6f windows: add tty unicode support for input
Switches from using ReadConsoleA to ReadConsoleW.
Uses an auxiliary buffer to store the temporary utf-16 string.

Signed-off-by: Peter Atashian <retep998@gmail.com>
Signed-off-by: Saúl Ibarra Corretgé <saghul@gmail.com>
2014-06-19 23:04:12 +02:00
Leith Bade
cf7b81230b build: add pthread-fixes.c to Makefile.am on Android 2014-06-19 22:58:52 +02:00
Saúl Ibarra Corretgé
58f87691a4 unix: fix bogus structure field name 2014-06-19 09:12:52 +02:00
Saúl Ibarra Corretgé
133b9d1cc1 unix: allow uv_getnameinfo to be cancelled 2014-06-18 02:00:07 +02:00
Saúl Ibarra Corretgé
dd893814ad unix: return system error on EAI_SYSTEM 2014-06-18 01:18:55 +02:00
Saúl Ibarra Corretgé
6ffb82ef08 unix: don't run i/o callbacks after prepare callbacks
Run them after timers, like Windows does.

Closes #1317
2014-06-18 01:13:21 +02:00
Saúl Ibarra Corretgé
12bb46c095 windows: fix handling closed socket while poll handle is closing
fixes #1278

(backport from master for v0.10 branch)
2014-06-17 20:16:43 +02:00
Saúl Ibarra Corretgé
a098ac66dd unix, windows: return system error on EAI_SYSTEM 2014-06-16 10:09:45 +02:00
Jay Satiro
90e4afd4fa windows: fix PYTHON environment variable usage
- (README.md) The PYTHON environment variable should point to python.exe
not the python directory.

- (vcvars.bat) The PYTHON environment variable should be quoted on
expansion in case there's spaces in the path.
2014-06-11 23:01:32 +02:00
Saúl Ibarra Corretgé
2d45af8b25 doc: remove requirement for signing the CLA 2014-06-11 22:18:36 +02:00
Fedor Indutny
c38e97ee4d test: fix EPIPE race in spawn_closed_process_io
The just created stdin should not be closed by a child process before
writing to it, otherwise EPIPE happens.
2014-06-09 08:47:18 -07:00
Ben Noordhuis
6c6c922167 test: make barrier test more rigorous
A correct barriers implementation blocks in uv_barrier_destroy() until
the last thread returns from uv_barrier_wait() so make the test more
rigorous by destroying the barrier straight away instead of first
joining the worker thread.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-06-07 07:57:10 -07:00
Ben Noordhuis
b64c359557 include: document barrier functions
Add some basic doc comments to the uv_barrier_*() functions and document
the "serializer" return value from the previous commit.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-06-07 07:57:09 -07:00
Ben Noordhuis
91985d48f6 unix, windows: make uv_barrier_wait() return bool
Make uv_barrier_wait() return a boolean value indicating whether this
thread was the "serializer".

From `man pthread_barrier_wait`:

    Upon successful completion, the pthread_barrier_wait() function
    shall return PTHREAD_BARRIER_SERIAL_THREAD for a single (arbitrary)
    thread synchronized at the barrier and zero for each of the other
    threads.

Exposing that information from libuv is useful because it can make
cleanup significantly easier:

    if (uv_barrier_wait(&barrier) > 0)
      uv_barrier_destroy(&barrier);

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-06-07 07:57:08 -07:00
Saúl Ibarra Corretgé
eee4776549 windows: fix handling closed socket while poll handle is closing
fixes #1278
2014-05-30 19:19:36 +02:00
Saúl Ibarra Corretgé
aab8d9dab4 doc: clarify return value when UV_RUN_NOWAIT is used
Signed-off-by: Saúl Ibarra Corretgé <saghul@gmail.com>
2014-05-25 23:39:40 +02:00
Saúl Ibarra Corretgé
4fac9427e4 unix, windows: fix parsing scoped IPv6 addresses
Signed-off-by: Saúl Ibarra Corretgé <saghul@gmail.com>
2014-05-25 23:30:46 +02:00
Saúl Ibarra Corretgé
e7b3c3fb6b unix, windows: define UV__INET/6_ADDRSTRLEN constants 2014-05-25 23:30:40 +02:00
HungMingWu
6d56e6e132 windows: remove redundant code in uv_tcp_write
The overlapped structure is reset twice, it is non necessary.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-24 19:08:27 +04:00
Fedor Indutny
e002340e50 heap: fix heap_remove()
Remove should shuffle items in both directions, not just down. It is
required, because `max` node could be not the actual maximum value in
the tree.

fix #1267

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-23 20:04:42 +04:00
Rasmus Christian Pedersen
70c42563c1 unix, windows: getnameinfo implementation
Closes #852
2014-05-20 17:33:52 +02:00
Saúl Ibarra Corretgé
1579788c50 unix, windows: avoid error in uv_fs_event_stop
For consistency with other handle types, if stop is called while the
handle wasn't started yet, it's a no-op.
2014-05-13 10:05:39 +02:00
Rasmus Christian Pedersen
ecaede660c unix, windows: uv_dlerror const argument 2014-05-13 00:00:54 +02:00
Rasmus Christian Pedersen
f629075530 win: open_named_pipe const argument 2014-05-13 00:00:54 +02:00
Rasmus Christian Pedersen
687322432d win: minor coding style cleanup 2014-05-13 00:00:54 +02:00
Ryan Cole
907b55e4bf process: adjust quote_cmd_arg for empty arguments
adjust quote_cmd_arg so that empty command line
arguments are double quoted instead of skipped
2014-05-12 23:55:58 +02:00
Luka Perkov
85e17ca665 doc: refer to README.md to find out more information about tests
Reason for this change is because 'make test' command does not work.

Signed-off-by: Luka Perkov <luka.perkov@sartura.hr>
2014-05-12 23:51:35 +02:00
Saúl Ibarra Corretgé
4ce5470f3a unix: fix uv__open_cloexec usage
It returns the fd or the negated errno.
2014-05-12 11:23:13 +02:00
Saúl Ibarra Corretgé
386d2141e4 unix, windows: be consistent when binding implictly in UDP
Only these functions will trigger an implicit binding of a UDP handle:
- uv_udp_send
- uv_udp_recv_start
- uv_udp_set_membership

All other functions will return UV_EBADF in case the socket was not
bound.

Note: currently the socket is created and bound at the same time. This
may change in the future.
2014-05-08 15:12:09 +02:00
Saúl Ibarra Corretgé
fa0e1e5071 unix, windows: remove unneeded define 2014-05-08 09:08:33 +02:00
Saúl Ibarra Corretgé
9f51f26e96 unix: fix handling error on UDP socket creation 2014-05-08 00:35:22 +02:00
JD Ballard
e56717ae98 windows: add invert ANSI (7 / 27) emulation 2014-05-03 09:13:28 -03:00
JD Ballard
21b1b87d12 windows: add VT100 codes ?25l and ?25h 2014-05-02 09:27:33 -03:00
Trevor Norris
32597100b8 thread: add uv_thread_cb typedef
To keep with convention, add a typedef for the function called that
initializes the new thread.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-02 01:33:13 +04:00
Timothy J Fontaine
4f8d4a0135 Now working on v0.10.28 2014-05-01 09:23:46 -07:00
Timothy J Fontaine
6e24ce23b1 2014.05.02, Version 0.10.27 (Stable)
Changes since version 0.10.26:

* windows: fix console signal handler refcount (Saúl Ibarra Corretgé)

* win: always leave crit section in get_proc_title (Fedor Indutny)
2014-05-01 09:23:46 -07:00
Timothy J Fontaine
b5548f18c9 Now working on v0.11.26 2014-05-01 09:16:48 -07:00
Timothy J Fontaine
2acd544cff 2014.05.02, Version 0.11.25 (Unstable)
Changes since version 0.11.24:

* osx: pass const handle pointer to uv___stream_fd (Chernyshev
  Viacheslav)

* unix, windows: pass const handle ptr to uv_tcp_get*name (Chernyshev
  Viacheslav)

* common: pass const sockaddr ptr to uv_ip*_name (Chernyshev Viacheslav)

* unix, windows: validate flags on uv_udp|tcp_bind (Saúl Ibarra
  Corretgé)

* unix: handle case when addr is not initialized after recvmsg (Saúl
  Ibarra Corretgé)

* unix, windows: uv_now constness (Rasmus Pedersen)
2014-05-01 09:16:45 -07:00
Rasmus Christian Pedersen
87ae69b638 unix, windows: uv_now constness
uv_now doesnt require modification of uv_loop_t as such argument is
changed to a const uv_loop_t* as this more in spirit with remaining
API in libuv.
2014-04-29 19:39:13 -03:00
Trevor Norris
4d905fbe07 test: close stream immediately on error
If there is an error in the uv_read_cb, close the uv_stream_t
immediately instead of waiting until the uv_write_cb, and only close the
stream in after_write() if it hasn't been closed already.
2014-04-24 16:48:27 -07:00
Saúl Ibarra Corretgé
76eb7518c6 doc: clarify what the addr argument of uv_udp_recv_cb contains 2014-04-23 19:28:30 +02:00
Saúl Ibarra Corretgé
f55b853be5 unix: handle case when addr is not initialized after recvmsg
If the handle was opened using `uv_udp_open` ift's possible that the
kernel doesn't fill in the msg_name field, so return NULL as the address
in that case.

fixes #1252
2014-04-23 19:19:23 +02:00