Commit Graph

522 Commits

Author SHA1 Message Date
Igor Zinkovsky
e7497227bd merge uv_tcp_listen and uv_pipe_listen into uv_listen 2011-07-22 16:57:09 -07:00
Ryan Dahl
84ebddad88 long lines 2011-07-22 03:35:12 -07:00
Bert Belder
2806b0386b Windows: do not initialize pipe handle in uv_pipe_accept 2011-07-22 12:08:27 +02:00
Ben Noordhuis
52487194cf uv-unix: fix 'comparison between signed and unsigned integer expressions' 2011-07-22 01:45:06 +02:00
Ben Noordhuis
272f164e6a uv-unix: uv_pipe_bind: raise UV_EACCESS on inaccessible socket
Fixes failing test pipe_bind_error_addrnotavail.
2011-07-21 19:48:42 +02:00
Igor Zinkovsky
186abb00bc windows: return UV_EACCESS for invalid pipe name 2011-07-21 10:39:08 -07:00
Ben Noordhuis
fb42f82df6 uv-unix: uv_pipe_bind: raise UV_EINVAL if pipe already bound
Fixes failing test pipe_bind_error_inval.
2011-07-21 18:18:34 +02:00
Ben Noordhuis
580a5b464f uv-unix: uv_pipe_listen: raise UV_ENOTCONN if pipe not bound
Fixes failing test pipe_listen_without_bind.
2011-07-21 18:18:34 +02:00
Ben Noordhuis
1028a9c6a7 uv-unix: handle EINTR properly
Fixes #113.
2011-07-21 15:22:59 +02:00
Bert Belder
5b532d5f60 Windows: do not hang if LOOP->refs become 0 in a prepare callback 2011-07-21 14:57:27 +02:00
Bert Belder
6e505766be Windows: follow libev loop semantics more closely 2011-07-21 04:25:01 +02:00
Igor Zinkovsky
f8bdddcda9 Allow pipe name to be in utf8 for uv_pipe_bind and uv_pipe_connect 2011-07-20 18:55:40 -07:00
Igor Zinkovsky
ee5236cf56 Windows: make uv_pipe_bind fail for the pipe name already in-use 2011-07-20 18:48:35 -07:00
Ben Noordhuis
c4611a4148 uv-unix: move stream->fd >= 0 asserts out of connection error path
on_connect callback must be invoked even if the connect() syscall
fails. stream->fd == -1 in that case.
2011-07-21 03:35:14 +02:00
Bert Belder
d9612fe0e7 More changes related to uv_close returning void 2011-07-21 03:27:43 +02:00
Ryan Dahl
b931c9313f uv_close returns void 2011-07-20 18:03:48 -07:00
Igor Zinkovsky
2765509430 Windows: Use PeekNamedPipe instead of non-blocking reads to peek at the pipe buffer 2011-07-21 02:25:09 +02:00
Ben Noordhuis
66f936bfd7 uv-unix: call uv__accept() instead of accept()
uv__accept() puts the socket in non-blocking close-on-exec mode,
accept() by itself does not.

Solves the case of the mysteriously hanging HTTP benchmarks.
2011-07-21 02:13:02 +02:00
Ben Noordhuis
332bbecd19 uv-unix: defer uv_pipe_connect callback to next tick 2011-07-20 23:06:44 +02:00
Ryan Dahl
1fda135ff2 understand EBADF 2011-07-20 11:05:53 -07:00
Ryan Dahl
eadfb14884 unix: uv_write shouldn't assert fd >= 0 2011-07-20 10:51:08 -07:00
Ben Noordhuis
ce5eb6d85a config-unix: drop --std=c89 on cygwin, hides CLOCK_MONOTONIC.
Fixes #112.
2011-07-20 17:58:27 +02:00
Ben Noordhuis
e6075842e8 uv-unix: in uv_pipe_init: zero the _whole_ uv_pipe_t struct. 2011-07-20 01:14:17 +02:00
Bert Belder
ca3cfbae74 Windows: use low-res event loop clock.
For much better performance. Closes #88.
2011-07-19 17:32:43 +02:00
Bert Belder
86f1ca90e5 Windows: implement uv_hrtime() 2011-07-19 15:01:12 +02:00
Bert Belder
cd0dcce98c Windows: use _strdup instead of strdup 2011-07-19 15:01:11 +02:00
Ben Noordhuis
7cc527997f uv-common: fix 'initialization discards qualifiers from pointer target type' 2011-07-19 13:51:31 +02:00
Ben Noordhuis
3207f8ae40 uv-unix: fix 'passing argument 1 of ‘uv__stream_open’ from incompatible pointer type' 2011-07-19 13:51:31 +02:00
Ben Noordhuis
c0d4669f87 uv-unix: fix 'implicit declaration of function ‘accept4’' 2011-07-19 13:51:31 +02:00
Ryan Dahl
d4563a197a Allow and test for lazy uv_tcp_listen 2011-07-19 02:40:54 -07:00
Bert Belder
3a91232f66 Split up uv-win.c 2011-07-19 03:47:30 +02:00
Ryan Dahl
07b49ce59a add uv_ip4_name and uv_ip6_name 2011-07-18 17:39:04 -07:00
Ben Noordhuis
4eff34da43 uv-unix: pipes API implementation
Based on UNIX sockets to avoid the vagaries of FIFOs
in asynchronous mode. Currently unlinks stale sockets
before binding and cleans them up again after shutdown.
2011-07-19 00:58:02 +02:00
Igor Zinkovsky
4d31f838b0 Windows: handle ERROR_PIPE_BUSY in uv_pipe_connect 2011-07-18 13:02:32 -07:00
Bert Belder
c1bddb9677 Stop g++ from complaining about anonymous struct usage 2011-07-16 00:33:31 +02:00
Bert Belder
d56af313ee Revert "uv_win: uv_pipe_connect should return -1 on error"
This reverts commit 7b4607348a.
2011-07-15 20:26:08 +02:00
Shigeki Ohtsu
1be48f12a0 ev: define HAVE_SYNC_FILE_RANGE if kernel >= 2.6.17 *and* glibc version >= 2.6 2011-07-15 15:44:20 +02:00
Henry Rawas
d540872107 uv-win: allow listen on unbound tcp handle 2011-07-15 02:49:34 +02:00
Bert Belder
7b4607348a uv_win: uv_pipe_connect should return -1 on error 2011-07-15 02:38:35 +02:00
Bert Belder
0ea4c87f8b Windows implementation of new request API
This changes uv-win to use the new uv_req subclasses.

It gets rid of the uv_req.flags field. There used to be only request flag
(UV_REQ_PENDING), and it was mostly obsolete; it only had a real purpose for
internal uv_read requests. Now we'll use the UV_HANDLE_READ_PENDING flag on
the handle instead.

This patch also simplifies the accept logic for named pipes on windows. We
no longer have a separate struct to store information about established
connections. Instead we just carry over the windows HANDLE from the accept
request to the client handle in uv_pipe_accept().
2011-07-14 10:46:08 -07:00
Ryan Dahl
abe0b1ea61 Better request API
Instead of uv_shutdown, uv_write, uv_connect taking raw uv_req_t we subclass
uv_req_t into uv_shutdown_t, uv_write_t, and uv_connect_t.

uv_req_init is removed.
2011-07-14 10:45:28 -07:00
Igor Zinkovsky
f5ff869488 allocate windows pipe handles on demand 2011-07-13 20:43:10 -07:00
Bert Belder
4a6efee4ce uv-win: get rid of unused variables 2011-07-14 03:00:20 +02:00
Ben Noordhuis
f142a4b60a uv-linux: remove unused variables 2011-07-13 23:59:30 +02:00
Ben Noordhuis
b50105e491 uv-unix: remove unused variable 2011-07-13 23:59:01 +02:00
Ben Noordhuis
932f0ad16b uv-linux: fix warning: implicit declaration of function ‘readlink’ 2011-07-13 23:46:30 +02:00
Ben Noordhuis
f560f75a17 uv-unix: fix warning: control reaches end of non-void function 2011-07-13 23:46:30 +02:00
Ben Noordhuis
e364dd15c1 uv-unix: fix warning: no return statement in function returning non-void 2011-07-13 23:46:30 +02:00
Ben Noordhuis
aad95b841e uv-unix: increment check_init counter in uv_check_init() 2011-07-13 23:05:09 +02:00
Bert Belder
28650425e2 uv-win: refactor request processing 2011-07-13 21:49:15 +02:00
Ben Noordhuis
48eb98c464 unix: implement uv_getsockname() 2011-07-13 00:55:35 +02:00
Ben Noordhuis
f852c517a1 Change uv_pipe_*() prototypes from char* to const char*. 2011-07-13 00:12:30 +02:00
Henry Rawas
6a67b51b4c fix uv_getsockname for listening socket 2011-07-12 22:43:43 +02:00
Henry Rawas
6b32ebc54f uv_getsockname 2011-07-12 09:57:08 -07:00
Igor Zinkovsky
2e49cc56d1 Rename uv_pipe_create to uv_pipe_bind.
Fixes issue #97.
2011-07-11 15:24:35 -07:00
Ben Noordhuis
1a0e452de1 freebsd: add uv_hrtime(). 2011-07-11 03:00:34 +02:00
Ben Noordhuis
cef595eedc Fix indentation in src/uv-freebsd.c 2011-07-11 03:00:34 +02:00
Ben Noordhuis
33b1b7acb9 Fix compiler errors on FreeBSD.
Fixes #93.
2011-07-11 02:43:01 +02:00
Ben Noordhuis
e2b2df6d2b Fix alloc-after-close error, properly disarm uv_tcp_t handle. 2011-07-10 16:50:28 +02:00
Igor Zinkovsky
b6a6dae34f Named pipes implementation for Windows 2011-07-09 21:41:04 +02:00
Bert Belder
5aa8c005ec Windows: call shutdown before closesocket to ensure graceful disconnect 2011-07-09 21:31:48 +02:00
Ben Noordhuis
f7a3789ee7 Remove zero-length buffers from the write queue.
Zero-length buffers were written out but not removed,
so the write loop never terminated.

Fixes failing node.js test test/simple/test-http-1.0.js
2011-07-09 01:25:39 +02:00
Igor Zinkovsky
e147155821 fix in uv_insert_pending_req to work with multiple requests 2011-07-08 11:49:04 -07:00
Robert Mustacchi
8287551b91 Fix SunOS build 2011-07-07 23:55:50 -07:00
Ryan Dahl
18fa8c0ecd Move ev.h to include/ 2011-07-07 21:55:01 -07:00
Robert Mustacchi
8c00b369b4 C99 compatibility.
Get 99% of the way there for --std=c89 -pedantic for core files. Also cleans
up follow up warnings and others in tests.
2011-07-07 21:39:08 -07:00
Robert Mustacchi
c946697e7c C89 compatibility.
This changes the libev constants to be the corresponding negative values.
Without this the header file is not valid ISO C 89. This fix makes the uv
header compile fine in a simple C 89 program.
2011-07-07 21:39:07 -07:00
Robert Mustacchi
341ecab2ef Remove extra dereference on hints 2011-07-07 21:39:07 -07:00
Ben Noordhuis
a74f339d17 Fix linux syscall detection. 2011-07-07 22:06:44 +02:00
Bert Belder
cb07847949 Remove obsolete file 2011-07-07 18:09:05 +02:00
Bert Belder
81bb15feed Change msvc projects, more sanity in ares build config on windows 2011-07-07 18:07:53 +02:00
Ryan Dahl
ce8ff3031c src/ and include/ directories
Helps #71 but does not update the MSVC files.
2011-07-07 07:52:57 -07:00