libuv integration
authorAndy Green <andy.green@linaro.org>
Sun, 14 Feb 2016 01:27:41 +0000 (09:27 +0800)
committerAndy Green <andy.green@linaro.org>
Sun, 14 Feb 2016 01:31:13 +0000 (09:31 +0800)
commit86ed65ff009e83c23c9d1933df155ecabaeb89b8
treef8b14d57835a4bb9b2e4694f62425c2a93cf0541
parent19bb09133ddfec722c937141b90ddd25da32eaad
libuv integration

This gets the libuv stuff plumbed in and working.

Currently it's only workable for some service thread, and there
is an isolated valgrind problem left

==28425== 128 bytes in 1 blocks are definitely lost in loss record 3 of 3
==28425==    at 0x4C28C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==28425==    by 0x4C2AB1E: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==28425==    by 0x58BBB27: maybe_resize (core.c:748)
==28425==    by 0x58BBB27: uv__io_start (core.c:787)
==28425==    by 0x58C1B80: uv__signal_loop_once_init (signal.c:225)
==28425==    by 0x58C1B80: uv_signal_init (signal.c:260)
==28425==    by 0x58BF7A6: uv_loop_init (loop.c:66)
==28425==    by 0x4157F5: lws_uv_initloop (libuv.c:89)
==28425==    by 0x405536: main (test-server-libuv.c:284)

libuv wants to sign off on all libuv 'handles' that will close, and
callback to do the close confirmation asynchronously.  The wsi close function
is adapted when libuv is in use to work with libuv accordingly and exit the uv
loop the number of remaining wsi is zero.

Signed-off-by: Andy Green <andy.green@linaro.org>
20 files changed:
CMakeLists.txt
README.coding.md
changelog
lib/client-handshake.c
lib/client.c
lib/context.c
lib/extension.c
lib/libev.c
lib/libuv.c [new file with mode: 0644]
lib/libwebsockets.c
lib/libwebsockets.h
lib/lws-plat-unix.c
lib/pollfd.c
lib/private-libwebsockets.h
lib/server.c
lib/service.c
lib/ssl.c
lws_config.h.in
test-server/test-server-libev.c
test-server/test-server-libuv.c