Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/v0.10'
Browse files Browse the repository at this point in the history
Conflicts:
	AUTHORS
	ChangeLog
	src/unix/darwin.c
	src/version.c
  • Loading branch information
bnoordhuis committed Nov 13, 2013
2 parents 6149b66 + 026241c commit 17711b9
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 28 deletions.
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,5 @@ Luca Bruno <lucab@debian.org>
Reini Urban <rurban@cpanel.net>
Maks Naumov <maksqwe1@ukr.net>
Sean Farrell <sean.farrell@rioki.org>
Chris Bank <cbank@adobe.com>
Geert Jansen <geertj@gmail.com>
21 changes: 21 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
2013.11.13, Version 0.10.19 (Stable), 33959f7524090b8d2c6c41e2400ca77e31755059

Changes since version 0.10.18:

* darwin: avoid calling GetCurrentProcess (Fedor Indutny)

* unix: update events from pevents between polls (Fedor Indutny)

* fsevents: support japaneese characters in path (Chris Bank)

* linux: don't turn on SO_REUSEPORT socket option (Ben Noordhuis)

* build: fix windows smp build with gyp (Geert Jansen)

* linux: handle EPOLLHUP without EPOLLIN/EPOLLOUT (Ben Noordhuis)

* unix: fix reopened fd bug (Fedor Indutny)

* core: fix fake watcher list and count preservation (Fedor Indutny)


2013.10.30, Version 0.11.14 (Unstable), d7a6482f45c1b4eb4a853dbe1a9ce8090a35633a

Changes since version 0.11.13:
Expand Down
19 changes: 0 additions & 19 deletions src/unix/darwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,6 @@ void uv__platform_loop_delete(uv_loop_t* loop) {
}


void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) {
struct kevent* events;
uintptr_t i;
uintptr_t nfds;

assert(loop->watchers != NULL);

events = (struct kevent*) loop->watchers[loop->nwatchers];
nfds = (uintptr_t) loop->watchers[loop->nwatchers + 1];
if (events == NULL)
return;

/* Invalidate events with same file descriptor */
for (i = 0; i < nfds; i++)
if ((int) events[i].ident == fd)
events[i].ident = -1;
}


uint64_t uv__hrtime(uv_clocktype_t type) {
mach_timebase_info_data_t info;

Expand Down
19 changes: 19 additions & 0 deletions src/unix/kqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,25 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
}


void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) {
struct kevent* events;
uintptr_t i;
uintptr_t nfds;

assert(loop->watchers != NULL);

events = (struct kevent*) loop->watchers[loop->nwatchers];
nfds = (uintptr_t) loop->watchers[loop->nwatchers + 1];
if (events == NULL)
return;

/* Invalidate events with same file descriptor */
for (i = 0; i < nfds; i++)
if ((int) events[i].ident == fd)
events[i].ident = -1;
}


static void uv__fs_event(uv_loop_t* loop, uv__io_t* w, unsigned int fflags) {
uv_fs_event_t* handle;
struct kevent ev;
Expand Down
24 changes: 15 additions & 9 deletions test/test-tcp-close-accept.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ static void connect_cb(uv_connect_t* req, int status) {
ASSERT(0 == uv_write(&write_reqs[i], outgoing, &buf, 1, write_cb));
}

static uv_buf_t alloc_cb(uv_handle_t* handle, size_t suggested_size) {
static char buf[1];

return uv_buf_init(buf, sizeof(buf));
static void alloc_cb(uv_handle_t* handle, size_t size, uv_buf_t* buf) {
static char slab[1];
buf->base = slab;
buf->len = sizeof(slab);
}

static void read_cb(uv_stream_t* stream, ssize_t nread, uv_buf_t b) {
static void read_cb(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) {
uv_loop_t* loop;
unsigned int i;

Expand All @@ -95,7 +95,10 @@ static void read_cb(uv_stream_t* stream, ssize_t nread, uv_buf_t b) {

/* Create new fd that should be one of the closed incomings */
ASSERT(0 == uv_tcp_init(loop, &tcp_check));
ASSERT(0 == uv_tcp_connect(&tcp_check_req, &tcp_check, addr, connect_cb));
ASSERT(0 == uv_tcp_connect(&tcp_check_req,
&tcp_check,
(const struct sockaddr*) &addr,
connect_cb));
ASSERT(0 == uv_read_start((uv_stream_t*) &tcp_check, alloc_cb, read_cb));

/* Close server, so no one will connect to it */
Expand Down Expand Up @@ -150,10 +153,10 @@ TEST_IMPL(tcp_close_accept) {
*/

loop = uv_default_loop();
addr = uv_ip4_addr("0.0.0.0", TEST_PORT);
ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr));

ASSERT(0 == uv_tcp_init(loop, &tcp_server));
ASSERT(0 == uv_tcp_bind(&tcp_server, addr));
ASSERT(0 == uv_tcp_bind(&tcp_server, (const struct sockaddr*) &addr));
ASSERT(0 == uv_listen((uv_stream_t*) &tcp_server,
ARRAY_SIZE(tcp_outgoing),
connection_cb));
Expand All @@ -162,7 +165,10 @@ TEST_IMPL(tcp_close_accept) {
client = tcp_outgoing + i;

ASSERT(0 == uv_tcp_init(loop, client));
ASSERT(0 == uv_tcp_connect(&connect_reqs[i], client, addr, connect_cb));
ASSERT(0 == uv_tcp_connect(&connect_reqs[i],
client,
(const struct sockaddr*) &addr,
connect_cb));
}

uv_run(loop, UV_RUN_DEFAULT);
Expand Down

0 comments on commit 17711b9

Please sign in to comment.