Browse Source

Upgrade libuv to f5ff8694

v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
7a782164b9
  1. 12
      deps/uv/Makefile
  2. 4
      deps/uv/config-mingw.mk
  3. 16
      deps/uv/config-unix.mk
  4. 1
      deps/uv/include/ares.h
  5. 4
      deps/uv/include/eio.h
  6. 4
      deps/uv/include/ev.h
  7. 5
      deps/uv/include/uv-unix.h
  8. 60
      deps/uv/include/uv-win.h
  9. 55
      deps/uv/include/uv.h
  10. 148
      deps/uv/msvs/c-ares.vcxproj
  11. 20
      deps/uv/msvs/libuv-benchmark.vcxproj
  12. 21
      deps/uv/msvs/libuv-test.vcxproj
  13. 51
      deps/uv/msvs/libuv.vcxproj
  14. 6
      deps/uv/src/ares/ares_setup.h
  15. 357
      deps/uv/src/ares/config-win32.h
  16. 671
      deps/uv/src/ares/config_win32/ares_config.h
  17. 7
      deps/uv/src/eio/config_linux.h
  18. 7
      deps/uv/src/ev/config_linux.h
  19. 2
      deps/uv/src/uv-common.h
  20. 24
      deps/uv/src/uv-freebsd.c
  21. 6
      deps/uv/src/uv-linux.c
  22. 3
      deps/uv/src/uv-sunos.c
  23. 63
      deps/uv/src/uv-unix.c
  24. 1146
      deps/uv/src/uv-win.c
  25. 28
      deps/uv/test/benchmark-list.h
  26. 158
      deps/uv/test/benchmark-pump.c
  27. 1
      deps/uv/test/benchmark-sizes.c
  28. 2
      deps/uv/test/dns-server.c
  29. 123
      deps/uv/test/echo-server.c
  30. 26
      deps/uv/test/run-benchmarks.c
  31. 53
      deps/uv/test/run-tests.c
  32. 8
      deps/uv/test/runner-unix.c
  33. 26
      deps/uv/test/runner-win.c
  34. 211
      deps/uv/test/runner.c
  35. 30
      deps/uv/test/runner.h
  36. 11
      deps/uv/test/task.h
  37. 2
      deps/uv/test/test-async.c
  38. 10
      deps/uv/test/test-callback-stack.c
  39. 2
      deps/uv/test/test-connection-fail.c
  40. 6
      deps/uv/test/test-delayed-accept.c
  41. 186
      deps/uv/test/test-getsockname.c
  42. 2
      deps/uv/test/test-hrtime.c
  43. 31
      deps/uv/test/test-list.h
  44. 87
      deps/uv/test/test-ping-pong.c
  45. 4
      deps/uv/test/test-shutdown-eof.c
  46. 8
      deps/uv/test/test-tcp-writealot.c
  47. 2
      src/tcp_wrap.cc

12
deps/uv/Makefile

@ -97,17 +97,23 @@ test/echo.o: test/echo.c test/echo.h
$(CC) $(CPPFLAGS) $(CFLAGS) -c test/echo.c -o test/echo.o $(CC) $(CPPFLAGS) $(CFLAGS) -c test/echo.c -o test/echo.o
.PHONY: clean clean-platform distclean distclean-platform test benchmark .PHONY: clean clean-platform distclean distclean-platform test bench
test: test/run-tests$(E) test: test/run-tests$(E)
test/run-tests test/run-tests
#test-%: test/run-tests$(E)
# test/run-tests $(@:test-%=%)
bench: test/run-benchmarks$(E) bench: test/run-benchmarks$(E)
test/run-benchmarks test/run-benchmarks
#bench-%: test/run-benchmarks$(E)
# test/run-benchmarks $(@:bench-%=%)
clean: clean-platform clean: clean-platform
$(RM) -f *.o *.a test/run-tests$(E) test/run-benchmarks$(E) $(RM) -f src/*.o *.a test/run-tests$(E) test/run-benchmarks$(E)
distclean: distclean-platform distclean: distclean-platform
$(RM) -f *.o *.a test/run-tests$(E) test/run-benchmarks$(E) $(RM) -f src/*.o *.a test/run-tests$(E) test/run-benchmarks$(E)

4
deps/uv/config-mingw.mk

@ -20,8 +20,8 @@
# Use make -f Makefile.gcc PREFIX=i686-w64-mingw32- # Use make -f Makefile.gcc PREFIX=i686-w64-mingw32-
# for cross compilation # for cross compilation
CC ?= $(PREFIX)gcc CC = $(PREFIX)gcc
AR ?= $(PREFIX)ar AR = $(PREFIX)ar
E=.exe E=.exe
CFLAGS=$(CPPFLAGS) -g --std=gnu89 -D_WIN32_WINNT=0x0501 -Isrc/ares/config_win32 CFLAGS=$(CPPFLAGS) -g --std=gnu89 -D_WIN32_WINNT=0x0501 -Isrc/ares/config_win32

16
deps/uv/config-unix.mk

@ -18,10 +18,11 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE. # IN THE SOFTWARE.
CC ?= $(PREFIX)gcc CC = $(PREFIX)gcc
AR ?= $(PREFIX)ar AR = $(PREFIX)ar
E= E=
CFLAGS=--std=gnu89 -g CSTDFLAG=--std=c89 -pedantic
CFLAGS=-g
CPPFLAGS += -Isrc/ev CPPFLAGS += -Isrc/ev
LINKFLAGS=-lm LINKFLAGS=-lm
@ -47,6 +48,7 @@ endif
ifeq (Linux,$(uname_S)) ifeq (Linux,$(uname_S))
EV_CONFIG=config_linux.h EV_CONFIG=config_linux.h
EIO_CONFIG=config_linux.h EIO_CONFIG=config_linux.h
CSTDFLAG += -D_XOPEN_SOURCE=600
CPPFLAGS += -Isrc/ares/config_linux CPPFLAGS += -Isrc/ares/config_linux
LINKFLAGS+=-lrt LINKFLAGS+=-lrt
UV_OS_FILE=uv-linux.c UV_OS_FILE=uv-linux.c
@ -80,13 +82,13 @@ uv.a: src/uv-unix.o src/uv-common.o src/uv-platform.o src/ev/ev.o src/uv-eio.o s
src/eio/eio.o $(CARES_OBJS) src/eio/eio.o $(CARES_OBJS)
src/uv-platform.o: src/$(UV_OS_FILE) include/uv.h include/uv-unix.h src/uv-platform.o: src/$(UV_OS_FILE) include/uv.h include/uv-unix.h
$(CC) $(CPPFLAGS) $(CFLAGS) -c src/$(UV_OS_FILE) -o src/uv-platform.o $(CC) $(CSTDFLAG) $(CPPFLAGS) $(CFLAGS) -c src/$(UV_OS_FILE) -o src/uv-platform.o
src/uv-unix.o: src/uv-unix.c include/uv.h include/uv-unix.h src/uv-unix.o: src/uv-unix.c include/uv.h include/uv-unix.h
$(CC) $(CPPFLAGS) -Ieio $(CFLAGS) -c src/uv-unix.c -o src/uv-unix.o $(CC) $(CSTDFLAG) $(CPPFLAGS) -Ieio $(CFLAGS) -c src/uv-unix.c -o src/uv-unix.o
src/uv-common.o: src/uv-common.c include/uv.h include/uv-unix.h src/uv-common.o: src/uv-common.c include/uv.h include/uv-unix.h
$(CC) $(CPPFLAGS) $(CFLAGS) -c src/uv-common.c -o src/uv-common.o $(CC) $(CSTDFLAG) $(CPPFLAGS) $(CFLAGS) -c src/uv-common.c -o src/uv-common.o
src/ev/ev.o: src/ev/ev.c src/ev/ev.o: src/ev/ev.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c src/ev/ev.c -o src/ev/ev.o -DEV_CONFIG_H=\"$(EV_CONFIG)\" $(CC) $(CPPFLAGS) $(CFLAGS) -c src/ev/ev.c -o src/ev/ev.o -DEV_CONFIG_H=\"$(EV_CONFIG)\"
@ -101,7 +103,7 @@ src/eio/eio.o: src/eio/eio.c
$(CC) $(EIO_CPPFLAGS) $(CFLAGS) -c src/eio/eio.c -o src/eio/eio.o $(CC) $(EIO_CPPFLAGS) $(CFLAGS) -c src/eio/eio.c -o src/eio/eio.o
src/uv-eio.o: src/uv-eio.c src/uv-eio.o: src/uv-eio.c
$(CC) $(CPPFLAGS) -Isrc/eio/ $(CFLAGS) -c src/uv-eio.c -o src/uv-eio.o $(CC) $(CPPFLAGS) -Isrc/eio/ $(CSTDFLAG) $(CFLAGS) -c src/uv-eio.c -o src/uv-eio.o
clean-platform: clean-platform:

1
deps/uv/include/ares.h

@ -52,6 +52,7 @@
#else /* Not Windows */ #else /* Not Windows */
# include <sys/time.h>
# include <sys/types.h> # include <sys/types.h>
# include <sys/socket.h> # include <sys/socket.h>
#endif #endif

4
deps/uv/include/eio.h

@ -176,7 +176,7 @@ enum
enum enum
{ {
EIO_MCL_CURRENT = 1, EIO_MCL_CURRENT = 1,
EIO_MCL_FUTURE = 2, EIO_MCL_FUTURE = 2
}; };
/* request priorities */ /* request priorities */
@ -184,7 +184,7 @@ enum
enum { enum {
EIO_PRI_MIN = -4, EIO_PRI_MIN = -4,
EIO_PRI_MAX = 4, EIO_PRI_MAX = 4,
EIO_PRI_DEFAULT = 0, EIO_PRI_DEFAULT = 0
}; };
/* eio request structure */ /* eio request structure */

4
deps/uv/src/ev/ev.h → deps/uv/include/ev.h

@ -197,7 +197,7 @@ struct ev_loop;
/* eventmask, revents, events... */ /* eventmask, revents, events... */
enum { enum {
EV_UNDEF = 0xFFFFFFFF, /* guaranteed to be invalid */ EV_UNDEF = -1, /* guaranteed to be invalid */
EV_NONE = 0x00, /* no events */ EV_NONE = 0x00, /* no events */
EV_READ = 0x01, /* ev_io detected read will not block */ EV_READ = 0x01, /* ev_io detected read will not block */
EV_WRITE = 0x02, /* ev_io detected write will not block */ EV_WRITE = 0x02, /* ev_io detected write will not block */
@ -219,7 +219,7 @@ enum {
EV_CLEANUP = 0x00040000, /* event loop resumed in child */ EV_CLEANUP = 0x00040000, /* event loop resumed in child */
EV_ASYNC = 0x00080000, /* async intra-loop signal */ EV_ASYNC = 0x00080000, /* async intra-loop signal */
EV_CUSTOM = 0x01000000, /* for use by user code */ EV_CUSTOM = 0x01000000, /* for use by user code */
EV_ERROR = 0x80000000 /* sent when an error occurs */ EV_ERROR = (-2147483647 - 1) /* sent when an error occurs */
}; };
/* can be used to add custom fields to all watchers, while losing binary compatibility */ /* can be used to add custom fields to all watchers, while losing binary compatibility */

5
deps/uv/include/uv-unix.h

@ -73,6 +73,11 @@ typedef struct {
ev_io write_watcher; \ ev_io write_watcher; \
ngx_queue_t write_queue; \ ngx_queue_t write_queue; \
ngx_queue_t write_completed_queue; ngx_queue_t write_completed_queue;
/* UV_NAMED_PIPE */
#define UV_PIPE_PRIVATE_TYPEDEF
#define UV_PIPE_PRIVATE_FIELDS
/* UV_PREPARE */ \ /* UV_PREPARE */ \

60
deps/uv/include/uv-win.h

@ -31,6 +31,8 @@
#include "tree.h" #include "tree.h"
#define MAX_PIPENAME_LEN 256
/** /**
* It should be possible to cast uv_buf_t[] to WSABUF[] * It should be possible to cast uv_buf_t[] to WSABUF[]
* see http://msdn.microsoft.com/en-us/library/ms741542(v=vs.85).aspx * see http://msdn.microsoft.com/en-us/library/ms741542(v=vs.85).aspx
@ -40,6 +42,22 @@ typedef struct uv_buf_t {
char* base; char* base;
} uv_buf_t; } uv_buf_t;
/*
* Private uv_pipe_instance state.
*/
typedef enum {
UV_PIPEINSTANCE_CONNECTED = 0,
UV_PIPEINSTANCE_DISCONNECTED,
UV_PIPEINSTANCE_ACTIVE
} uv_pipeinstance_state;
/* Used to store active pipe instances inside a linked list. */
typedef struct uv_pipe_instance_s {
HANDLE handle;
uv_pipeinstance_state state;
struct uv_pipe_instance_s* next;
} uv_pipe_instance_t;
#define UV_REQ_PRIVATE_FIELDS \ #define UV_REQ_PRIVATE_FIELDS \
union { \ union { \
/* Used by I/O operations */ \ /* Used by I/O operations */ \
@ -52,30 +70,46 @@ typedef struct uv_buf_t {
uv_err_t error; \ uv_err_t error; \
struct uv_req_s* next_req; struct uv_req_s* next_req;
#define uv_stream_connection_fields \
unsigned int write_reqs_pending; \
uv_req_t* shutdown_req;
#define uv_stream_server_fields \
uv_connection_cb connection_cb;
#define UV_STREAM_PRIVATE_FIELDS \ #define UV_STREAM_PRIVATE_FIELDS \
unsigned int reqs_pending; \
uv_alloc_cb alloc_cb; \ uv_alloc_cb alloc_cb; \
uv_read_cb read_cb; \ uv_read_cb read_cb; \
struct uv_req_s read_req; \ struct uv_req_s read_req; \
union { \
#define uv_tcp_connection_fields \ struct { uv_stream_connection_fields }; \
unsigned int write_reqs_pending; \ struct { uv_stream_server_fields }; \
uv_req_t* shutdown_req; };
#define uv_tcp_server_fields \
uv_connection_cb connection_cb; \
SOCKET accept_socket; \
struct uv_req_s accept_req; \
char accept_buffer[sizeof(struct sockaddr_storage) * 2 + 32];
#define UV_TCP_PRIVATE_FIELDS \ #define UV_TCP_PRIVATE_FIELDS \
unsigned int reqs_pending; \
union { \ union { \
SOCKET socket; \ SOCKET socket; \
HANDLE handle; \ HANDLE handle; \
}; \ }; \
SOCKET accept_socket; \
char accept_buffer[sizeof(struct sockaddr_storage) * 2 + 32]; \
struct uv_req_s accept_req;
#define uv_pipe_server_fields \
char* name; \
uv_pipe_instance_t* connections; \
struct uv_req_s accept_reqs[4];
#define uv_pipe_connection_fields \
uv_pipe_t* server; \
uv_pipe_instance_t* connection; \
uv_pipe_instance_t clientConnection;
#define UV_PIPE_PRIVATE_FIELDS \
union { \ union { \
struct { uv_tcp_connection_fields }; \ struct { uv_pipe_server_fields }; \
struct { uv_tcp_server_fields }; \ struct { uv_pipe_connection_fields }; \
}; };
#define UV_TIMER_PRIVATE_FIELDS \ #define UV_TIMER_PRIVATE_FIELDS \

55
deps/uv/include/uv.h

@ -43,6 +43,7 @@ typedef struct uv_err_s uv_err_t;
typedef struct uv_handle_s uv_handle_t; typedef struct uv_handle_s uv_handle_t;
typedef struct uv_stream_s uv_stream_t; typedef struct uv_stream_s uv_stream_t;
typedef struct uv_tcp_s uv_tcp_t; typedef struct uv_tcp_s uv_tcp_t;
typedef struct uv_pipe_s uv_pipe_t;
typedef struct uv_timer_s uv_timer_t; typedef struct uv_timer_s uv_timer_t;
typedef struct uv_prepare_s uv_prepare_t; typedef struct uv_prepare_s uv_prepare_t;
typedef struct uv_check_s uv_check_t; typedef struct uv_check_s uv_check_t;
@ -124,7 +125,8 @@ typedef enum {
UV_EAIFAMNOSUPPORT, UV_EAIFAMNOSUPPORT,
UV_EAINONAME, UV_EAINONAME,
UV_EAISERVICE, UV_EAISERVICE,
UV_EAISOCKTYPE UV_EAISOCKTYPE,
UV_ESHUTDOWN
} uv_err_code; } uv_err_code;
typedef enum { typedef enum {
@ -138,8 +140,8 @@ typedef enum {
UV_CHECK, UV_CHECK,
UV_IDLE, UV_IDLE,
UV_ASYNC, UV_ASYNC,
UV_ARES,
UV_ARES_TASK, UV_ARES_TASK,
UV_ARES_EVENT,
UV_GETADDRINFO UV_GETADDRINFO
} uv_handle_type; } uv_handle_type;
@ -150,7 +152,11 @@ typedef enum {
UV_READ, UV_READ,
UV_WRITE, UV_WRITE,
UV_SHUTDOWN, UV_SHUTDOWN,
UV_WAKEUP UV_WAKEUP,
/* TODO: remove the req suffix */
UV_ARES_EVENT_REQ,
UV_ARES_CLEANUP_REQ,
UV_GETADDRINFO_REQ
} uv_req_type; } uv_req_type;
@ -167,7 +173,7 @@ struct uv_req_s {
uv_req_type type; uv_req_type type;
/* public */ /* public */
uv_handle_t* handle; uv_handle_t* handle;
void* cb; void *(*cb)(void *);
void* data; void* data;
/* private */ /* private */
UV_REQ_PRIVATE_FIELDS UV_REQ_PRIVATE_FIELDS
@ -176,7 +182,7 @@ struct uv_req_s {
/* /*
* Initialize a request for use with uv_write, uv_shutdown, or uv_connect. * Initialize a request for use with uv_write, uv_shutdown, or uv_connect.
*/ */
void uv_req_init(uv_req_t* req, uv_handle_t* handle, void* cb); void uv_req_init(uv_req_t* req, uv_handle_t* handle, void *(*cb)(void *));
int uv_shutdown(uv_req_t* req); int uv_shutdown(uv_req_t* req);
@ -188,7 +194,7 @@ int uv_shutdown(uv_req_t* req);
uv_close_cb close_cb; \ uv_close_cb close_cb; \
void* data; \ void* data; \
/* private */ \ /* private */ \
UV_HANDLE_PRIVATE_FIELDS \ UV_HANDLE_PRIVATE_FIELDS
/* The abstract base class of all handles. */ /* The abstract base class of all handles. */
struct uv_handle_s { struct uv_handle_s {
@ -212,7 +218,7 @@ int uv_close(uv_handle_t* handle, uv_close_cb close_cb);
/* number of bytes queued for writing */ \ /* number of bytes queued for writing */ \
size_t write_queue_size; \ size_t write_queue_size; \
/* private */ \ /* private */ \
UV_STREAM_PRIVATE_FIELDS \ UV_STREAM_PRIVATE_FIELDS
/* The abstract base class for all streams. */ /* The abstract base class for all streams. */
struct uv_stream_s { struct uv_stream_s {
@ -286,6 +292,26 @@ int uv_tcp_connect6(uv_req_t* req, struct sockaddr_in6);
int uv_tcp_listen(uv_tcp_t* handle, int backlog, uv_connection_cb cb); int uv_tcp_listen(uv_tcp_t* handle, int backlog, uv_connection_cb cb);
int uv_getsockname(uv_tcp_t* handle, struct sockaddr* name, int* namelen);
/*
* A subclass of uv_stream_t representing a pipe stream or pipe server.
*/
struct uv_pipe_s {
UV_HANDLE_FIELDS
UV_STREAM_FIELDS
UV_PIPE_PRIVATE_FIELDS
};
int uv_pipe_init(uv_pipe_t* handle);
int uv_pipe_bind(uv_pipe_t* handle, const char* name);
int uv_pipe_listen(uv_pipe_t* handle, uv_connection_cb cb);
int uv_pipe_connect(uv_req_t* req, const char* name);
/* /*
* Subclass of uv_handle_t. libev wrapper. Every active prepare handle gets * Subclass of uv_handle_t. libev wrapper. Every active prepare handle gets
@ -466,6 +492,7 @@ extern uint64_t uv_hrtime(void);
/* the presence of this union forces similar struct layout */ /* the presence of this union forces similar struct layout */
union uv_any_handle { union uv_any_handle {
uv_tcp_t tcp; uv_tcp_t tcp;
uv_pipe_t pipe;
uv_prepare_t prepare; uv_prepare_t prepare;
uv_check_t check; uv_check_t check;
uv_idle_t idle; uv_idle_t idle;
@ -478,7 +505,9 @@ union uv_any_handle {
typedef struct { typedef struct {
uint64_t req_init; uint64_t req_init;
uint64_t handle_init; uint64_t handle_init;
uint64_t stream_init;
uint64_t tcp_init; uint64_t tcp_init;
uint64_t pipe_init;
uint64_t prepare_init; uint64_t prepare_init;
uint64_t check_init; uint64_t check_init;
uint64_t idle_init; uint64_t idle_init;
@ -488,6 +517,18 @@ typedef struct {
uv_counters_t* uv_counters(); uv_counters_t* uv_counters();
/* Don't export the private CPP symbols. */
#undef UV_REQ_PRIVATE_FIELDS
#undef UV_STREAM_PRIVATE_FIELDS
#undef UV_TCP_PRIVATE_FIELDS
#undef UV_PREPARE_PRIVATE_FIELDS
#undef UV_CHECK_PRIVATE_FIELDS
#undef UV_IDLE_PRIVATE_FIELDS
#undef UV_ASYNC_PRIVATE_FIELDS
#undef UV_TIMER_PRIVATE_FIELDS
#undef UV_GETADDRINFO_PRIVATE_FIELDS
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

148
deps/uv/msvs/c-ares.vcxproj

@ -72,108 +72,108 @@
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;CARES_BUILDING_LIBRARY;CARES_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;HAVE_CONFIG_H;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\c-ares;..\c-ares\config_win32</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\include;..\src\ares\config_win32</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile> <ClCompile>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;CARES_BUILDING_LIBRARY;CARES_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;HAVE_CONFIG_H;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\c-ares;..\c-ares\config_win32</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\include;..\src\ares\config_win32</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile> <ClCompile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalIncludeDirectories>..\c-ares;..\c-ares\config_win32</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\include;..\src\ares\config_win32</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_LIB;CARES_BUILDING_LIBRARY;CARES_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;HAVE_CONFIG_H;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile> </ClCompile>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile> <ClCompile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalIncludeDirectories>..\c-ares;..\c-ares\config_win32</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\include;..\src\ares\config_win32</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_LIB;CARES_BUILDING_LIBRARY;CARES_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;HAVE_CONFIG_H;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile> </ClCompile>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\c-ares\ares__close_sockets.c" /> <ClCompile Include="..\src\ares\ares__close_sockets.c" />
<ClCompile Include="..\c-ares\ares__get_hostent.c" /> <ClCompile Include="..\src\ares\ares__get_hostent.c" />
<ClCompile Include="..\c-ares\ares__read_line.c" /> <ClCompile Include="..\src\ares\ares__read_line.c" />
<ClCompile Include="..\c-ares\ares__timeval.c" /> <ClCompile Include="..\src\ares\ares__timeval.c" />
<ClCompile Include="..\c-ares\ares_cancel.c" /> <ClCompile Include="..\src\ares\ares_cancel.c" />
<ClCompile Include="..\c-ares\ares_data.c" /> <ClCompile Include="..\src\ares\ares_data.c" />
<ClCompile Include="..\c-ares\ares_destroy.c" /> <ClCompile Include="..\src\ares\ares_destroy.c" />
<ClCompile Include="..\c-ares\ares_expand_name.c" /> <ClCompile Include="..\src\ares\ares_expand_name.c" />
<ClCompile Include="..\c-ares\ares_expand_string.c" /> <ClCompile Include="..\src\ares\ares_expand_string.c" />
<ClCompile Include="..\c-ares\ares_fds.c" /> <ClCompile Include="..\src\ares\ares_fds.c" />
<ClCompile Include="..\c-ares\ares_free_hostent.c" /> <ClCompile Include="..\src\ares\ares_free_hostent.c" />
<ClCompile Include="..\c-ares\ares_free_string.c" /> <ClCompile Include="..\src\ares\ares_free_string.c" />
<ClCompile Include="..\c-ares\ares_gethostbyaddr.c" /> <ClCompile Include="..\src\ares\ares_gethostbyaddr.c" />
<ClCompile Include="..\c-ares\ares_gethostbyname.c" /> <ClCompile Include="..\src\ares\ares_gethostbyname.c" />
<ClCompile Include="..\c-ares\ares_getnameinfo.c" /> <ClCompile Include="..\src\ares\ares_getnameinfo.c" />
<ClCompile Include="..\c-ares\ares_getsock.c" /> <ClCompile Include="..\src\ares\ares_getsock.c" />
<ClCompile Include="..\c-ares\ares_init.c" /> <ClCompile Include="..\src\ares\ares_init.c" />
<ClCompile Include="..\c-ares\ares_library_init.c" /> <ClCompile Include="..\src\ares\ares_library_init.c" />
<ClCompile Include="..\c-ares\ares_llist.c" /> <ClCompile Include="..\src\ares\ares_llist.c" />
<ClCompile Include="..\c-ares\ares_mkquery.c" /> <ClCompile Include="..\src\ares\ares_mkquery.c" />
<ClCompile Include="..\c-ares\ares_nowarn.c" /> <ClCompile Include="..\src\ares\ares_nowarn.c" />
<ClCompile Include="..\c-ares\ares_options.c" /> <ClCompile Include="..\src\ares\ares_options.c" />
<ClCompile Include="..\c-ares\ares_parse_a_reply.c" /> <ClCompile Include="..\src\ares\ares_parse_a_reply.c" />
<ClCompile Include="..\c-ares\ares_parse_aaaa_reply.c" /> <ClCompile Include="..\src\ares\ares_parse_aaaa_reply.c" />
<ClCompile Include="..\c-ares\ares_parse_mx_reply.c" /> <ClCompile Include="..\src\ares\ares_parse_mx_reply.c" />
<ClCompile Include="..\c-ares\ares_parse_ns_reply.c" /> <ClCompile Include="..\src\ares\ares_parse_ns_reply.c" />
<ClCompile Include="..\c-ares\ares_parse_ptr_reply.c" /> <ClCompile Include="..\src\ares\ares_parse_ptr_reply.c" />
<ClCompile Include="..\c-ares\ares_parse_srv_reply.c" /> <ClCompile Include="..\src\ares\ares_parse_srv_reply.c" />
<ClCompile Include="..\c-ares\ares_parse_txt_reply.c" /> <ClCompile Include="..\src\ares\ares_parse_txt_reply.c" />
<ClCompile Include="..\c-ares\ares_process.c" /> <ClCompile Include="..\src\ares\ares_process.c" />
<ClCompile Include="..\c-ares\ares_query.c" /> <ClCompile Include="..\src\ares\ares_query.c" />
<ClCompile Include="..\c-ares\ares_search.c" /> <ClCompile Include="..\src\ares\ares_search.c" />
<ClCompile Include="..\c-ares\ares_send.c" /> <ClCompile Include="..\src\ares\ares_send.c" />
<ClCompile Include="..\c-ares\ares_strcasecmp.c" /> <ClCompile Include="..\src\ares\ares_strcasecmp.c" />
<ClCompile Include="..\c-ares\ares_strdup.c" /> <ClCompile Include="..\src\ares\ares_strdup.c" />
<ClCompile Include="..\c-ares\ares_strerror.c" /> <ClCompile Include="..\src\ares\ares_strerror.c" />
<ClCompile Include="..\c-ares\ares_timeout.c" /> <ClCompile Include="..\src\ares\ares_timeout.c" />
<ClCompile Include="..\c-ares\ares_version.c" /> <ClCompile Include="..\src\ares\ares_version.c" />
<ClCompile Include="..\c-ares\ares_writev.c" /> <ClCompile Include="..\src\ares\ares_writev.c" />
<ClCompile Include="..\c-ares\bitncmp.c" /> <ClCompile Include="..\src\ares\bitncmp.c" />
<ClCompile Include="..\c-ares\inet_net_pton.c" /> <ClCompile Include="..\src\ares\inet_net_pton.c" />
<ClCompile Include="..\c-ares\inet_ntop.c" /> <ClCompile Include="..\src\ares\inet_ntop.c" />
<ClCompile Include="..\c-ares\windows_port.c" /> <ClCompile Include="..\src\ares\windows_port.c" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\c-ares\ares.h" /> <ClInclude Include="..\include\ares.h" />
<ClInclude Include="..\c-ares\ares_data.h" /> <ClInclude Include="..\include\ares_version.h" />
<ClInclude Include="..\c-ares\ares_dns.h" /> <ClInclude Include="..\src\ares\ares_data.h" />
<ClInclude Include="..\c-ares\ares_iphlpapi.h" /> <ClInclude Include="..\src\ares\ares_dns.h" />
<ClInclude Include="..\c-ares\ares_ipv6.h" /> <ClInclude Include="..\src\ares\ares_iphlpapi.h" />
<ClInclude Include="..\c-ares\ares_library_init.h" /> <ClInclude Include="..\src\ares\ares_ipv6.h" />
<ClInclude Include="..\c-ares\ares_llist.h" /> <ClInclude Include="..\src\ares\ares_library_init.h" />
<ClInclude Include="..\c-ares\ares_nowarn.h" /> <ClInclude Include="..\src\ares\ares_llist.h" />
<ClInclude Include="..\c-ares\ares_private.h" /> <ClInclude Include="..\src\ares\ares_nowarn.h" />
<ClInclude Include="..\c-ares\ares_rules.h" /> <ClInclude Include="..\src\ares\ares_private.h" />
<ClInclude Include="..\c-ares\ares_setup.h" /> <ClInclude Include="..\src\ares\ares_rules.h" />
<ClInclude Include="..\c-ares\ares_strcasecmp.h" /> <ClInclude Include="..\src\ares\ares_setup.h" />
<ClInclude Include="..\c-ares\ares_strdup.h" /> <ClInclude Include="..\src\ares\ares_strcasecmp.h" />
<ClInclude Include="..\c-ares\ares_version.h" /> <ClInclude Include="..\src\ares\ares_strdup.h" />
<ClInclude Include="..\c-ares\ares_writev.h" /> <ClInclude Include="..\src\ares\ares_version.h" />
<ClInclude Include="..\c-ares\bitncmp.h" /> <ClInclude Include="..\src\ares\ares_writev.h" />
<ClInclude Include="..\c-ares\config-win32.h" /> <ClInclude Include="..\src\ares\bitncmp.h" />
<ClInclude Include="..\c-ares\config_win32\ares_config.h" /> <ClInclude Include="..\src\ares\config_win32\ares_config.h" />
<ClInclude Include="..\c-ares\inet_net_pton.h" /> <ClInclude Include="..\src\ares\inet_net_pton.h" />
<ClInclude Include="..\c-ares\inet_ntop.h" /> <ClInclude Include="..\src\ares\inet_ntop.h" />
<ClInclude Include="..\c-ares\nameser.h" /> <ClInclude Include="..\src\ares\nameser.h" />
<ClInclude Include="..\c-ares\setup_once.h" /> <ClInclude Include="..\src\ares\setup_once.h" />
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>
</Project> </Project>

20
deps/uv/msvs/libuv-benchmark.vcxproj

@ -81,7 +81,7 @@
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\c-ares\config_win32</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\include;..\src\ares\config_win32</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<Link> <Link>
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
@ -97,7 +97,7 @@
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\c-ares\config_win32</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\include;..\src\ares\config_win32</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<Link> <Link>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
@ -111,7 +111,7 @@
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>..\c-ares\config_win32</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\include;..\src\ares\config_win32</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<Link> <Link>
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
@ -128,7 +128,7 @@
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>..\c-ares\config_win32</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\include;..\src\ares\config_win32</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<Link> <Link>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
@ -147,23 +147,11 @@
<ClCompile Include="..\test\dns-server.c" /> <ClCompile Include="..\test\dns-server.c" />
<ClCompile Include="..\test\echo-server.c" /> <ClCompile Include="..\test\echo-server.c" />
<ClCompile Include="..\test\run-benchmarks.c" /> <ClCompile Include="..\test\run-benchmarks.c" />
<ClCompile Include="..\test\runner-unix.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\test\runner-win.c" /> <ClCompile Include="..\test\runner-win.c" />
<ClCompile Include="..\test\runner.c" /> <ClCompile Include="..\test\runner.c" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\test\benchmark-list.h" /> <ClInclude Include="..\test\benchmark-list.h" />
<ClInclude Include="..\test\runner-unix.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="..\test\runner-win.h" /> <ClInclude Include="..\test\runner-win.h" />
<ClInclude Include="..\test\runner.h" /> <ClInclude Include="..\test\runner.h" />
<ClInclude Include="..\test\task.h" /> <ClInclude Include="..\test\task.h" />

21
deps/uv/msvs/libuv-test.vcxproj

@ -82,7 +82,7 @@
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\c-ares\config_win32</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\include;..\src\ares\config_win32</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<Link> <Link>
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
@ -98,7 +98,7 @@
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\c-ares\config_win32</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\include;..\src\ares\config_win32</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<Link> <Link>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
@ -112,7 +112,7 @@
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>..\c-ares\config_win32</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\include;..\src\ares\config_win32</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<Link> <Link>
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
@ -129,7 +129,7 @@
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>..\c-ares\config_win32</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\include;..\src\ares\config_win32</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<Link> <Link>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
@ -141,12 +141,6 @@
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\test\echo-server.c" /> <ClCompile Include="..\test\echo-server.c" />
<ClCompile Include="..\test\runner-unix.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\test\test-async.c" /> <ClCompile Include="..\test\test-async.c" />
<ClCompile Include="..\test\test-bind6-error.c" /> <ClCompile Include="..\test\test-bind6-error.c" />
<ClCompile Include="..\test\test-delayed-accept.c" /> <ClCompile Include="..\test\test-delayed-accept.c" />
@ -156,6 +150,7 @@
<ClCompile Include="..\test\test-fail-always.c" /> <ClCompile Include="..\test\test-fail-always.c" />
<ClCompile Include="..\test\test-gethostbyname.c" /> <ClCompile Include="..\test\test-gethostbyname.c" />
<ClCompile Include="..\test\test-getaddrinfo.c" /> <ClCompile Include="..\test\test-getaddrinfo.c" />
<ClCompile Include="..\test\test-getsockname.c" />
<ClCompile Include="..\test\test-hrtime.c" /> <ClCompile Include="..\test\test-hrtime.c" />
<ClCompile Include="..\test\test-loop-handles.c" /> <ClCompile Include="..\test\test-loop-handles.c" />
<ClCompile Include="..\test\test-pass-always.c" /> <ClCompile Include="..\test\test-pass-always.c" />
@ -170,12 +165,6 @@
<ClCompile Include="..\test\run-tests.c" /> <ClCompile Include="..\test\run-tests.c" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\test\runner-unix.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="..\test\test-list.h" /> <ClInclude Include="..\test\test-list.h" />
<ClInclude Include="..\test\runner-win.h" /> <ClInclude Include="..\test\runner-win.h" />
<ClInclude Include="..\test\runner.h" /> <ClInclude Include="..\test\runner.h" />

51
deps/uv/msvs/libuv.vcxproj

@ -78,7 +78,7 @@
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\c-ares\config_win32</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\include;..\src\ares\config_win32</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@ -88,52 +88,21 @@
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\c-ares\config_win32</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\include;..\src\ares\config_win32</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile> <ClCompile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalIncludeDirectories>..\c-ares\config_win32</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\include;..\src\ares\config_win32</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile> <ClCompile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalIncludeDirectories>..\c-ares\config_win32</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\include;..\src\ares\config_win32</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\ngx-queue.h" />
<ClInclude Include="..\uv-unix.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="..\uv-win.h" />
<ClInclude Include="..\uv.h" />
<ClInclude Include="..\tree.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\uv-unix.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\uv-win.c" />
<ClCompile Include="..\uv-common.c" />
</ItemGroup>
<ItemGroup>
<None Include="..\AUTHORS" />
<None Include="..\config-mingw.mk" />
<None Include="..\config-unix.mk" />
<None Include="..\iocp-links.html" />
<None Include="..\LICENSE" />
<None Include="..\Makefile" />
<None Include="..\README" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="c-ares.vcxproj"> <ProjectReference Include="c-ares.vcxproj">
<Project>{2b6a4644-eba9-dfb5-af35-6c56edf05c7f}</Project> <Project>{2b6a4644-eba9-dfb5-af35-6c56edf05c7f}</Project>
@ -144,6 +113,18 @@
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs> <UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\uv-common.c" />
<ClCompile Include="..\src\uv-win.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\ares.h" />
<ClInclude Include="..\include\ares_version.h" />
<ClInclude Include="..\include\tree.h" />
<ClInclude Include="..\include\uv-win.h" />
<ClInclude Include="..\include\uv.h" />
<ClInclude Include="..\src\uv-common.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>

6
deps/uv/src/ares/ares_setup.h

@ -31,12 +31,6 @@
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "ares_config.h" #include "ares_config.h"
#else
#ifdef WIN32
#include "config-win32.h"
#endif
#endif /* HAVE_CONFIG_H */ #endif /* HAVE_CONFIG_H */
/* ================================================================ */ /* ================================================================ */

357
deps/uv/src/ares/config-win32.h

@ -1,357 +0,0 @@
#ifndef __ARES_CONFIG_WIN32_H
#define __ARES_CONFIG_WIN32_H
/* Copyright (C) 2004 - 2008 by Daniel Stenberg et al
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of M.I.T. not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. M.I.T. makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*/
/* ================================================================ */
/* ares/config-win32.h - Hand crafted config file for Windows */
/* ================================================================ */
/* ---------------------------------------------------------------- */
/* HEADER FILES */
/* ---------------------------------------------------------------- */
/* Define if you have the <getopt.h> header file. */
#if defined(__MINGW32__) || defined(__POCC__)
#define HAVE_GETOPT_H 1
#endif
/* Define if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define if you have the <process.h> header file. */
#ifndef __SALFORDC__
#define HAVE_PROCESS_H 1
#endif
/* Define if you have the <signal.h> header file. */
#define HAVE_SIGNAL_H 1
/* Define if you have the <sys/time.h> header file */
/* #define HAVE_SYS_TIME_H 1 */
/* Define if you have the <time.h> header file. */
#define HAVE_TIME_H 1
/* Define if you have the <unistd.h> header file. */
#if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__) || \
defined(__POCC__)
#define HAVE_UNISTD_H 1
#endif
/* Define if you have the <winsock.h> header file. */
#define HAVE_WINSOCK_H 1
/* Define if you have the <winsock2.h> header file. */
#ifndef __SALFORDC__
#define HAVE_WINSOCK2_H 1
#endif
/* Define if you have the <ws2tcpip.h> header file. */
#ifndef __SALFORDC__
#define HAVE_WS2TCPIP_H 1
#endif
/* ---------------------------------------------------------------- */
/* OTHER HEADER INFO */
/* ---------------------------------------------------------------- */
/* Define if sig_atomic_t is an available typedef. */
#define HAVE_SIG_ATOMIC_T 1
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define if you can safely include both <sys/time.h> and <time.h>. */
/* #define TIME_WITH_SYS_TIME 1 */
/* ---------------------------------------------------------------- */
/* FUNCTIONS */
/* ---------------------------------------------------------------- */
/* Define if you have the closesocket function. */
#define HAVE_CLOSESOCKET 1
/* Define if you have the gethostname function. */
#define HAVE_GETHOSTNAME 1
/* Define if you have the ioctlsocket function. */
#define HAVE_IOCTLSOCKET 1
/* Define if you have a working ioctlsocket FIONBIO function. */
#define HAVE_IOCTLSOCKET_FIONBIO 1
/* Define if you have the strcasecmp function. */
/* #define HAVE_STRCASECMP 1 */
/* Define if you have the strdup function. */
#define HAVE_STRDUP 1
/* Define if you have the stricmp function. */
#define HAVE_STRICMP 1
/* Define if you have the strncasecmp function. */
/* #define HAVE_STRNCASECMP 1 */
/* Define if you have the strnicmp function. */
#define HAVE_STRNICMP 1
/* Define if you have the recv function. */
#define HAVE_RECV 1
/* Define to the type of arg 1 for recv. */
#define RECV_TYPE_ARG1 SOCKET
/* Define to the type of arg 2 for recv. */
#define RECV_TYPE_ARG2 char *
/* Define to the type of arg 3 for recv. */
#define RECV_TYPE_ARG3 int
/* Define to the type of arg 4 for recv. */
#define RECV_TYPE_ARG4 int
/* Define to the function return type for recv. */
#define RECV_TYPE_RETV int
/* Define if you have the recvfrom function. */
#define HAVE_RECVFROM 1
/* Define to the type of arg 1 for recvfrom. */
#define RECVFROM_TYPE_ARG1 SOCKET
/* Define to the type pointed by arg 2 for recvfrom. */
#define RECVFROM_TYPE_ARG2 char
/* Define to the type of arg 3 for recvfrom. */
#define RECVFROM_TYPE_ARG3 int
/* Define to the type of arg 4 for recvfrom. */
#define RECVFROM_TYPE_ARG4 int
/* Define to the type pointed by arg 5 for recvfrom. */
#define RECVFROM_TYPE_ARG5 struct sockaddr
/* Define to the type pointed by arg 6 for recvfrom. */
#define RECVFROM_TYPE_ARG6 int
/* Define to the function return type for recvfrom. */
#define RECVFROM_TYPE_RETV int
/* Define if you have the send function. */
#define HAVE_SEND 1
/* Define to the type of arg 1 for send. */
#define SEND_TYPE_ARG1 SOCKET
/* Define to the type qualifier of arg 2 for send. */
#define SEND_QUAL_ARG2 const
/* Define to the type of arg 2 for send. */
#define SEND_TYPE_ARG2 char *
/* Define to the type of arg 3 for send. */
#define SEND_TYPE_ARG3 int
/* Define to the type of arg 4 for send. */
#define SEND_TYPE_ARG4 int
/* Define to the function return type for send. */
#define SEND_TYPE_RETV int
/* Specifics for the Watt-32 tcp/ip stack */
#ifdef WATT32
#define SOCKET int
#define NS_INADDRSZ 4
#define HAVE_ARPA_NAMESER_H 1
#define HAVE_ARPA_INET_H 1
#define HAVE_NETDB_H 1
#define HAVE_NETINET_IN_H 1
#define HAVE_SYS_SOCKET_H 1
#define HAVE_NETINET_TCP_H 1
#define HAVE_AF_INET6 1
#define HAVE_PF_INET6 1
#define HAVE_STRUCT_IN6_ADDR 1
#define HAVE_STRUCT_SOCKADDR_IN6 1
#undef HAVE_WINSOCK_H
#undef HAVE_WINSOCK2_H
#undef HAVE_WS2TCPIP_H
#endif
/* ---------------------------------------------------------------- */
/* TYPEDEF REPLACEMENTS */
/* ---------------------------------------------------------------- */
/* Define this if in_addr_t is not an available 'typedefed' type */
#define in_addr_t unsigned long
/* Define as the return type of signal handlers (int or void). */
#define RETSIGTYPE void
/* Define ssize_t if it is not an available 'typedefed' type */
#ifndef _SSIZE_T_DEFINED
# if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || \
defined(__POCC__) || \
defined(__MINGW32__)
# elif defined(_WIN64)
# define _SSIZE_T_DEFINED
# define ssize_t __int64
# else
# define _SSIZE_T_DEFINED
# define ssize_t int
# endif
#endif
/* ---------------------------------------------------------------- */
/* TYPE SIZES */
/* ---------------------------------------------------------------- */
/* The size of `int', as computed by sizeof. */
#define SIZEOF_INT 4
/* The size of `short', as computed by sizeof. */
#define SIZEOF_SHORT 2
/* The size of `size_t', as computed by sizeof. */
#if defined(_WIN64)
# define SIZEOF_SIZE_T 8
#else
# define SIZEOF_SIZE_T 4
#endif
/* ---------------------------------------------------------------- */
/* STRUCT RELATED */
/* ---------------------------------------------------------------- */
/* Define this if you have struct addrinfo */
#define HAVE_STRUCT_ADDRINFO 1
/* Define this if you have struct sockaddr_storage */
#ifndef __SALFORDC__
#define HAVE_STRUCT_SOCKADDR_STORAGE 1
#endif
/* Define this if you have struct timeval */
#define HAVE_STRUCT_TIMEVAL 1
/* ---------------------------------------------------------------- */
/* COMPILER SPECIFIC */
/* ---------------------------------------------------------------- */
/* Define to avoid VS2005 complaining about portable C functions */
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
#define _CRT_SECURE_NO_DEPRECATE 1
#define _CRT_NONSTDC_NO_DEPRECATE 1
#endif
/* Officially, Microsoft's Windows SDK versions 6.X do not support Windows
2000 as a supported build target. VS2008 default installations provide an
embedded Windows SDK v6.0A along with the claim that Windows 2000 is a
valid build target for VS2008. Popular belief is that binaries built using
Windows SDK versions 6.X and Windows 2000 as a build target are functional */
#if defined(_MSC_VER) && (_MSC_VER >= 1500)
# define VS2008_MINIMUM_TARGET 0x0500
#endif
/* When no build target is specified VS2008 default build target is Windows
Vista, which leaves out even Winsows XP. If no build target has been given
for VS2008 we will target the minimum Officially supported build target,
which happens to be Windows XP. */
#if defined(_MSC_VER) && (_MSC_VER >= 1500)
# define VS2008_DEFAULT_TARGET 0x0501
#endif
/* VS2008 default target settings and minimum build target check */
#if defined(_MSC_VER) && (_MSC_VER >= 1500)
# ifndef _WIN32_WINNT
# define _WIN32_WINNT VS2008_DEFAULT_TARGET
# endif
# ifndef WINVER
# define WINVER VS2008_DEFAULT_TARGET
# endif
# if (_WIN32_WINNT < VS2008_MINIMUM_TARGET) || (WINVER < VS2008_MINIMUM_TARGET)
# error VS2008 does not support Windows build targets prior to Windows 2000
# endif
#endif
/* When no build target is specified Pelles C 5.00 and later default build
target is Windows Vista. We override default target to be Windows 2000. */
#if defined(__POCC__) && (__POCC__ >= 500)
# ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0500
# endif
# ifndef WINVER
# define WINVER 0x0500
# endif
#endif
/* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is
quite convoluted, compiler dependent and even build target dependent. */
#if defined(HAVE_WS2TCPIP_H)
# if defined(__POCC__)
# define HAVE_FREEADDRINFO 1
# define HAVE_GETADDRINFO 1
# define HAVE_GETNAMEINFO 1
# elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
# define HAVE_FREEADDRINFO 1
# define HAVE_GETADDRINFO 1
# define HAVE_GETNAMEINFO 1
# elif defined(_MSC_VER) && (_MSC_VER >= 1200)
# define HAVE_FREEADDRINFO 1
# define HAVE_GETADDRINFO 1
# define HAVE_GETNAMEINFO 1
# endif
#endif
#if defined(__POCC__)
# ifndef _MSC_VER
# error Microsoft extensions /Ze compiler option is required
# endif
# ifndef __POCC__OLDNAMES
# error Compatibility names /Go compiler option is required
# endif
#endif
/* ---------------------------------------------------------------- */
/* IPV6 COMPATIBILITY */
/* ---------------------------------------------------------------- */
/* Define this if you have address family AF_INET6 */
#ifdef HAVE_WINSOCK2_H
#define HAVE_AF_INET6 1
#endif
/* Define this if you have protocol family PF_INET6 */
#ifdef HAVE_WINSOCK2_H
#define HAVE_PF_INET6 1
#endif
/* Define this if you have struct in6_addr */
#ifdef HAVE_WS2TCPIP_H
#define HAVE_STRUCT_IN6_ADDR 1
#endif
/* Define this if you have struct sockaddr_in6 */
#ifdef HAVE_WS2TCPIP_H
#define HAVE_STRUCT_SOCKADDR_IN6 1
#endif
/* Define this if you have sockaddr_in6 with scopeid */
#ifdef HAVE_WS2TCPIP_H
#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
#endif
#endif /* __ARES_CONFIG_WIN32_H */

671
deps/uv/src/ares/config_win32/ares_config.h

@ -1,382 +1,145 @@
/* ares_config.h. Generated from ares_config.h.in by configure. */ #ifndef __ARES_CONFIG_WIN32_H
/* ares_config.h.in. Generated from configure.ac by autoheader. */ #define __ARES_CONFIG_WIN32_H
/* Define if building universal (internal helper macro) */
/* #undef AC_APPLE_UNIVERSAL_BUILD */
/* define this if ares is built for a big endian system */
/* #undef ARES_BIG_ENDIAN */
/* when building as static part of libcurl */
/* #undef BUILDING_LIBCURL */
/* when building c-ares library */ /* when building c-ares library */
/* #undef CARES_BUILDING_LIBRARY */ #define CARES_BUILDING_LIBRARY 1
/* when not building a shared library */ /* when not building a shared library */
#define CARES_STATICLIB 1 #define CARES_STATICLIB 1
/* Define to 1 to enable hiding of library internal symbols. */ /* Copyright (C) 2004 - 2008 by Daniel Stenberg et al
/* #undef CARES_SYMBOL_HIDING */ *
* Permission to use, copy, modify, and distribute this software and its
/* Definition to make a library symbol externally visible. */ * documentation for any purpose and without fee is hereby granted, provided
/* #undef CARES_SYMBOL_SCOPE_EXTERN */ * that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
/* if a /etc/inet dir is being used */ * documentation, and that the name of M.I.T. not be used in advertising or
/* #undef ETC_INET */ * publicity pertaining to distribution of the software without specific,
* written prior permission. M.I.T. makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*/
#define ARES_
/* ================================================================ */
/* ares/config-win32.h - Hand crafted config file for Windows */
/* ================================================================ */
/* ---------------------------------------------------------------- */
/* HEADER FILES */
/* ---------------------------------------------------------------- */
/* Define if you have the <getopt.h> header file. */
#if defined(__MINGW32__) || defined(__POCC__)
#define HAVE_GETOPT_H 1
#endif
/* Define to the type qualifier of arg 1 for getnameinfo. */ /* Define if you have the <limits.h> header file. */
/* #undef GETNAMEINFO_QUAL_ARG1 */ #define HAVE_LIMITS_H 1
/* Define to the type of arg 1 for getnameinfo. */ /* Define if you have the <process.h> header file. */
/* #undef GETNAMEINFO_TYPE_ARG1 */ #ifndef __SALFORDC__
#define HAVE_PROCESS_H 1
#endif
/* Define to the type of arg 2 for getnameinfo. */ /* Define if you have the <signal.h> header file. */
/* #undef GETNAMEINFO_TYPE_ARG2 */ #define HAVE_SIGNAL_H 1
/* Define to the type of args 4 and 6 for getnameinfo. */ /* Define if you have the <sys/time.h> header file */
/* #undef GETNAMEINFO_TYPE_ARG46 */ #if defined(__MINGW32__)
#define HAVE_SYS_TIME_H 1
#endif
/* Define to the type of arg 7 for getnameinfo. */ /* Define if you have the <time.h> header file. */
/* #undef GETNAMEINFO_TYPE_ARG7 */ #define HAVE_TIME_H 1
/* Specifies the number of arguments to getservbyport_r */ /* Define if you have the <unistd.h> header file. */
/* #undef GETSERVBYPORT_R_ARGS */ #if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__) || \
defined(__POCC__)
#define HAVE_UNISTD_H 1
#endif
/* Specifies the size of the buffer to pass to getservbyport_r */ /* Define if you have the windows.h header file. */
/* #undef GETSERVBYPORT_R_BUFSIZE */ #define HAVE_WINDOWS_H 1
/* Define to 1 if you have AF_INET6. */ /* Define if you have the <winsock.h> header file. */
#define HAVE_AF_INET6 1 #define HAVE_WINSOCK_H 1
/* Define to 1 if you have the <arpa/inet.h> header file. */ /* Define if you have the <winsock2.h> header file. */
/* #undef HAVE_ARPA_INET_H */ #ifndef __SALFORDC__
#define HAVE_WINSOCK2_H 1
#endif
/* Define to 1 if you have the <arpa/nameser_compat.h> header file. */ /* Define if you have the <ws2tcpip.h> header file. */
/* #undef HAVE_ARPA_NAMESER_COMPAT_H */ #ifndef __SALFORDC__
#define HAVE_WS2TCPIP_H 1
#endif
/* Define to 1 if you have the <arpa/nameser.h> header file. */ /* ---------------------------------------------------------------- */
/* #undef HAVE_ARPA_NAMESER_H */ /* OTHER HEADER INFO */
/* ---------------------------------------------------------------- */
/* Define to 1 if you have the <assert.h> header file. */ /* Define if sig_atomic_t is an available typedef. */
#define HAVE_ASSERT_H 1 #define HAVE_SIG_ATOMIC_T 1
/* Define to 1 if you have the `bitncmp' function. */ /* Define if you have the ANSI C header files. */
/* #undef HAVE_BITNCMP */ #define STDC_HEADERS 1
/* Define to 1 if bool is an available type. */ /* Define if you can safely include both <sys/time.h> and <time.h>. */
#define HAVE_BOOL_T 1 /* #define TIME_WITH_SYS_TIME 1 */
/* Define to 1 if you have the clock_gettime function and monotonic timer. */ /* ---------------------------------------------------------------- */
/* #undef HAVE_CLOCK_GETTIME_MONOTONIC */ /* FUNCTIONS */
/* ---------------------------------------------------------------- */
/* Define to 1 if you have the closesocket function. */ /* Define if you have the closesocket function. */
#define HAVE_CLOSESOCKET 1 #define HAVE_CLOSESOCKET 1
/* Define to 1 if you have the CloseSocket camel case function. */ /* Define if you have the gethostname function. */
/* #undef HAVE_CLOSESOCKET_CAMEL */
/* Define to 1 if you have the connect function. */
#define HAVE_CONNECT 1
/* Define to 1 if you have the <dlfcn.h> header file. */
/* #undef HAVE_DLFCN_H */
/* Define to 1 if you have the <errno.h> header file. */
#define HAVE_ERRNO_H 1
/* Define to 1 if you have the fcntl function. */
/* #undef HAVE_FCNTL */
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if you have a working fcntl O_NONBLOCK function. */
/* #undef HAVE_FCNTL_O_NONBLOCK */
/* Define to 1 if you have the freeaddrinfo function. */
/* #undef HAVE_FREEADDRINFO */
/* Define to 1 if you have a working getaddrinfo function. */
/* #undef HAVE_GETADDRINFO */
/* Define to 1 if the getaddrinfo function is threadsafe. */
/* #undef HAVE_GETADDRINFO_THREADSAFE */
/* Define to 1 if you have the gethostbyaddr function. */
#define HAVE_GETHOSTBYADDR 1
/* Define to 1 if you have the gethostbyname function. */
#define HAVE_GETHOSTBYNAME 1
/* Define to 1 if you have the gethostname function. */
#define HAVE_GETHOSTNAME 1 #define HAVE_GETHOSTNAME 1
/* Define to 1 if you have the getnameinfo function. */ /* Define if you have the ioctlsocket function. */
/* #undef HAVE_GETNAMEINFO */
/* Define to 1 if you have the getservbyport_r function. */
/* #undef HAVE_GETSERVBYPORT_R */
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1
/* Define to 1 if you have the `if_indextoname' function. */
/* #undef HAVE_IF_INDEXTONAME */
/* Define to 1 if you have the `inet_net_pton' function. */
/* #undef HAVE_INET_NET_PTON */
/* Define to 1 if inet_net_pton supports IPv6. */
/* #undef HAVE_INET_NET_PTON_IPV6 */
/* Define to 1 if you have a IPv6 capable working inet_ntop function. */
/* #undef HAVE_INET_NTOP */
/* Define to 1 if you have a IPv6 capable working inet_pton function. */
/* #undef HAVE_INET_PTON */
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the ioctl function. */
/* #undef HAVE_IOCTL */
/* Define to 1 if you have the ioctlsocket function. */
#define HAVE_IOCTLSOCKET 1 #define HAVE_IOCTLSOCKET 1
/* Define to 1 if you have the IoctlSocket camel case function. */ /* Define if you have a working ioctlsocket FIONBIO function. */
/* #undef HAVE_IOCTLSOCKET_CAMEL */
/* Define to 1 if you have a working IoctlSocket camel case FIONBIO function.
*/
/* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */
/* Define to 1 if you have a working ioctlsocket FIONBIO function. */
#define HAVE_IOCTLSOCKET_FIONBIO 1 #define HAVE_IOCTLSOCKET_FIONBIO 1
/* Define to 1 if you have a working ioctl FIONBIO function. */ /* Define if you have the strcasecmp function. */
/* #undef HAVE_IOCTL_FIONBIO */ /* #define HAVE_STRCASECMP 1 */
/* Define to 1 if you have a working ioctl SIOCGIFADDR function. */
/* #undef HAVE_IOCTL_SIOCGIFADDR */
/* Define to 1 if you have the `resolve' library (-lresolve). */
/* #undef HAVE_LIBRESOLVE */
/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* if your compiler supports LL */
#define HAVE_LL 1
/* Define to 1 if the compiler supports the 'long long' data type. */
#define HAVE_LONGLONG 1
/* Define to 1 if you have the malloc.h header file. */
#define HAVE_MALLOC_H 1
/* Define to 1 if you have the memory.h header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the MSG_NOSIGNAL flag. */
/* #undef HAVE_MSG_NOSIGNAL */
/* Define to 1 if you have the <netdb.h> header file. */
/* #undef HAVE_NETDB_H */
/* Define to 1 if you have the <netinet/in.h> header file. */
/* #undef HAVE_NETINET_IN_H */
/* Define to 1 if you have the <netinet/tcp.h> header file. */
/* #undef HAVE_NETINET_TCP_H */
/* Define to 1 if you have the <net/if.h> header file. */
/* #undef HAVE_NET_IF_H */
/* Define to 1 if you have PF_INET6. */
#define HAVE_PF_INET6 1
/* Define to 1 if you have the recv function. */
#define HAVE_RECV 1
/* Define to 1 if you have the recvfrom function. */
#define HAVE_RECVFROM 1
/* Define to 1 if you have the send function. */
#define HAVE_SEND 1
/* Define to 1 if you have the setsockopt function. */
#define HAVE_SETSOCKOPT 1
/* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */
/* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */
/* Define to 1 if you have the <signal.h> header file. */
#define HAVE_SIGNAL_H 1
/* Define to 1 if sig_atomic_t is an available typedef. */
#define HAVE_SIG_ATOMIC_T 1
/* Define to 1 if sig_atomic_t is already defined as volatile. */
/* #undef HAVE_SIG_ATOMIC_T_VOLATILE */
/* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */
#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
/* Define to 1 if you have the socket function. */ /* Define if you have the strdup function. */
#define HAVE_SOCKET 1
/* Define to 1 if you have the <socket.h> header file. */
/* #undef HAVE_SOCKET_H */
/* Define to 1 if you have the <stdbool.h> header file. */
#define HAVE_STDBOOL_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the strcasecmp function. */
#define HAVE_STRCASECMP 1
/* Define to 1 if you have the strcmpi function. */
#define HAVE_STRCMPI 1
/* Define to 1 if you have the strdup function. */
#define HAVE_STRDUP 1 #define HAVE_STRDUP 1
/* Define to 1 if you have the stricmp function. */ /* Define if you have the stricmp function. */
#define HAVE_STRICMP 1 #define HAVE_STRICMP 1
/* Define to 1 if you have the <strings.h> header file. */ /* Define if you have the strncasecmp function. */
#define HAVE_STRINGS_H 1 /* #define HAVE_STRNCASECMP 1 */
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the strncasecmp function. */
#define HAVE_STRNCASECMP 1
/* Define to 1 if you have the strncmpi function. */
/* #undef HAVE_STRNCMPI */
/* Define to 1 if you have the strnicmp function. */
/* #undef HAVE_STRNICMP */
/* Define to 1 if you have the <stropts.h> header file. */
/* #undef HAVE_STROPTS_H */
/* Define to 1 if you have struct addrinfo. */
#define HAVE_STRUCT_ADDRINFO 1
/* Define to 1 if you have struct in6_addr. */
#define HAVE_STRUCT_IN6_ADDR 1
/* Define to 1 if you have struct sockaddr_in6. */
#define HAVE_STRUCT_SOCKADDR_IN6 1
/* if struct sockaddr_storage is defined */
#define HAVE_STRUCT_SOCKADDR_STORAGE 1
/* Define to 1 if you have the timeval struct. */
#define HAVE_STRUCT_TIMEVAL 1
/* Define to 1 if you have the <sys/ioctl.h> header file. */
/* #undef HAVE_SYS_IOCTL_H */
/* Define to 1 if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1
/* Define to 1 if you have the <sys/select.h> header file. */
/* #undef HAVE_SYS_SELECT_H */
/* Define to 1 if you have the <sys/socket.h> header file. */ /* Define if you have the strnicmp function. */
/* #undef HAVE_SYS_SOCKET_H */ #define HAVE_STRNICMP 1
/* Define to 1 if you have the <sys/stat.h> header file. */ /* Define if you have the recv function. */
#define HAVE_SYS_STAT_H 1 #define HAVE_RECV 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <sys/uio.h> header file. */
/* #undef HAVE_SYS_UIO_H */
/* Define to 1 if you have the <time.h> header file. */
#define HAVE_TIME_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the windows.h header file. */
#define HAVE_WINDOWS_H 1
/* Define to 1 if you have the winsock2.h header file. */
#define HAVE_WINSOCK2_H 1
/* Define to 1 if you have the winsock.h header file. */
#define HAVE_WINSOCK_H 1
/* Define to 1 if you have the writev function. */
/* #undef HAVE_WRITEV */
/* Define to 1 if you have the ws2tcpip.h header file. */
#define HAVE_WS2TCPIP_H 1
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#define LT_OBJDIR ".libs/"
/* Define to 1 if you are building a native Windows target. */
#define NATIVE_WINDOWS 1
/* Define to 1 if you need the malloc.h header file even with stdlib.h */
/* #undef NEED_MALLOC_H */
/* Define to 1 if you need the memory.h header file even with stdlib.h */
/* #undef NEED_MEMORY_H */
/* Define to 1 if _REENTRANT preprocessor symbol must be defined. */
/* #undef NEED_REENTRANT */
/* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */
/* #undef NEED_THREAD_SAFE */
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
/* #undef NO_MINUS_C_MINUS_O */
/* cpu-machine-OS */
#define OS "i686-pc-mingw32"
/* Name of package */
#define PACKAGE "c-ares"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "c-ares mailing list => http://cool.haxx.se/mailman/listinfo/c-ares"
/* Define to the full name of this package. */ /* Define to the type of arg 1 for recv. */
#define PACKAGE_NAME "c-ares" #define RECV_TYPE_ARG1 SOCKET
/* Define to the full name and version of this package. */ /* Define to the type of arg 2 for recv. */
#define PACKAGE_STRING "c-ares 1.7.3" #define RECV_TYPE_ARG2 char *
/* Define to the one symbol short name of this package. */ /* Define to the type of arg 3 for recv. */
#define PACKAGE_TARNAME "c-ares" #define RECV_TYPE_ARG3 int
/* Define to the home page for this package. */ /* Define to the type of arg 4 for recv. */
#define PACKAGE_URL "" #define RECV_TYPE_ARG4 int
/* Define to the version of this package. */ /* Define to the function return type for recv. */
#define PACKAGE_VERSION "1.7.3" #define RECV_TYPE_RETV int
/* a suitable file/device to read random data from */ /* Define if you have the recvfrom function. */
#define RANDOM_FILE "/dev/urandom" #define HAVE_RECVFROM 1
/* Define to the type of arg 1 for recvfrom. */ /* Define to the type of arg 1 for recvfrom. */
#define RECVFROM_TYPE_ARG1 SOCKET #define RECVFROM_TYPE_ARG1 SOCKET
@ -384,9 +147,6 @@
/* Define to the type pointed by arg 2 for recvfrom. */ /* Define to the type pointed by arg 2 for recvfrom. */
#define RECVFROM_TYPE_ARG2 char #define RECVFROM_TYPE_ARG2 char
/* Define to 1 if the type pointed by arg 2 for recvfrom is void. */
/* #undef RECVFROM_TYPE_ARG2_IS_VOID */
/* Define to the type of arg 3 for recvfrom. */ /* Define to the type of arg 3 for recvfrom. */
#define RECVFROM_TYPE_ARG3 int #define RECVFROM_TYPE_ARG3 int
@ -396,42 +156,21 @@
/* Define to the type pointed by arg 5 for recvfrom. */ /* Define to the type pointed by arg 5 for recvfrom. */
#define RECVFROM_TYPE_ARG5 struct sockaddr #define RECVFROM_TYPE_ARG5 struct sockaddr
/* Define to 1 if the type pointed by arg 5 for recvfrom is void. */
/* #undef RECVFROM_TYPE_ARG5_IS_VOID */
/* Define to the type pointed by arg 6 for recvfrom. */ /* Define to the type pointed by arg 6 for recvfrom. */
#define RECVFROM_TYPE_ARG6 int #define RECVFROM_TYPE_ARG6 int
/* Define to 1 if the type pointed by arg 6 for recvfrom is void. */
/* #undef RECVFROM_TYPE_ARG6_IS_VOID */
/* Define to the function return type for recvfrom. */ /* Define to the function return type for recvfrom. */
#define RECVFROM_TYPE_RETV int #define RECVFROM_TYPE_RETV int
/* Define to the type of arg 1 for recv. */ /* Define if you have the send function. */
#define RECV_TYPE_ARG1 SOCKET #define HAVE_SEND 1
/* Define to the type of arg 2 for recv. */
#define RECV_TYPE_ARG2 char *
/* Define to the type of arg 3 for recv. */
#define RECV_TYPE_ARG3 int
/* Define to the type of arg 4 for recv. */
#define RECV_TYPE_ARG4 int
/* Define to the function return type for recv. */
#define RECV_TYPE_RETV int
/* Define as the return type of signal handlers (`int' or `void'). */ /* Define to the type of arg 1 for send. */
#define RETSIGTYPE void #define SEND_TYPE_ARG1 SOCKET
/* Define to the type qualifier of arg 2 for send. */ /* Define to the type qualifier of arg 2 for send. */
#define SEND_QUAL_ARG2 const #define SEND_QUAL_ARG2 const
/* Define to the type of arg 1 for send. */
#define SEND_TYPE_ARG1 SOCKET
/* Define to the type of arg 2 for send. */ /* Define to the type of arg 2 for send. */
#define SEND_TYPE_ARG2 char * #define SEND_TYPE_ARG2 char *
@ -444,67 +183,187 @@
/* Define to the function return type for send. */ /* Define to the function return type for send. */
#define SEND_TYPE_RETV int #define SEND_TYPE_RETV int
/* Specifics for the Watt-32 tcp/ip stack */
#ifdef WATT32
#define SOCKET int
#define NS_INADDRSZ 4
#define HAVE_ARPA_NAMESER_H 1
#define HAVE_ARPA_INET_H 1
#define HAVE_NETDB_H 1
#define HAVE_NETINET_IN_H 1
#define HAVE_SYS_SOCKET_H 1
#define HAVE_NETINET_TCP_H 1
#define HAVE_AF_INET6 1
#define HAVE_PF_INET6 1
#define HAVE_STRUCT_IN6_ADDR 1
#define HAVE_STRUCT_SOCKADDR_IN6 1
#undef HAVE_WINSOCK_H
#undef HAVE_WINSOCK2_H
#undef HAVE_WS2TCPIP_H
#endif
/* ---------------------------------------------------------------- */
/* TYPEDEF REPLACEMENTS */
/* ---------------------------------------------------------------- */
/* Define this if in_addr_t is not an available 'typedefed' type */
#define in_addr_t unsigned long
/* Define as the return type of signal handlers (int or void). */
#define RETSIGTYPE void
/* Define ssize_t if it is not an available 'typedefed' type */
#ifndef _SSIZE_T_DEFINED
# if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || \
defined(__POCC__) || \
defined(__MINGW32__)
# elif defined(_WIN64)
# define _SSIZE_T_DEFINED
# define ssize_t __int64
# else
# define _SSIZE_T_DEFINED
# define ssize_t int
# endif
#endif
/* ---------------------------------------------------------------- */
/* TYPE SIZES */
/* ---------------------------------------------------------------- */
/* The size of `int', as computed by sizeof. */ /* The size of `int', as computed by sizeof. */
#define SIZEOF_INT 4 #define SIZEOF_INT 4
/* The size of `long', as computed by sizeof. */ /* The size of `short', as computed by sizeof. */
#define SIZEOF_LONG 4 #define SIZEOF_SHORT 2
/* The size of `size_t', as computed by sizeof. */ /* The size of `size_t', as computed by sizeof. */
#define SIZEOF_SIZE_T 4 #if defined(_WIN64)
# define SIZEOF_SIZE_T 8
#else
# define SIZEOF_SIZE_T 4
#endif
/* The size of `struct in6_addr', as computed by sizeof. */ /* ---------------------------------------------------------------- */
#define SIZEOF_STRUCT_IN6_ADDR 16 /* STRUCT RELATED */
/* ---------------------------------------------------------------- */
/* The size of `struct in_addr', as computed by sizeof. */ /* Define this if you have struct addrinfo */
#define SIZEOF_STRUCT_IN_ADDR 4 #define HAVE_STRUCT_ADDRINFO 1
/* The size of `time_t', as computed by sizeof. */ /* Define this if you have struct sockaddr_storage */
#define SIZEOF_TIME_T 4 #ifndef __SALFORDC__
#define HAVE_STRUCT_SOCKADDR_STORAGE 1
#endif
/* Define to 1 if you have the ANSI C header files. */ /* Define this if you have struct timeval */
#define STDC_HEADERS 1 #define HAVE_STRUCT_TIMEVAL 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ /* ---------------------------------------------------------------- */
#define TIME_WITH_SYS_TIME 1 /* COMPILER SPECIFIC */
/* ---------------------------------------------------------------- */
/* Define to disable non-blocking sockets. */ /* Define to avoid VS2005 complaining about portable C functions */
/* #undef USE_BLOCKING_SOCKETS */ #if defined(_MSC_VER) && (_MSC_VER >= 1400)
#define _CRT_SECURE_NO_DEPRECATE 1
#define _CRT_NONSTDC_NO_DEPRECATE 1
#endif
/* Version number of package */ /* Officially, Microsoft's Windows SDK versions 6.X do not support Windows
#define VERSION "1.7.3" 2000 as a supported build target. VS2008 default installations provide an
embedded Windows SDK v6.0A along with the claim that Windows 2000 is a
valid build target for VS2008. Popular belief is that binaries built using
Windows SDK versions 6.X and Windows 2000 as a build target are functional */
#if defined(_MSC_VER) && (_MSC_VER >= 1500)
# define VS2008_MINIMUM_TARGET 0x0500
#endif
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most /* When no build target is specified VS2008 default build target is Windows
significant byte first (like Motorola and SPARC, unlike Intel). */ Vista, which leaves out even Winsows XP. If no build target has been given
#if defined AC_APPLE_UNIVERSAL_BUILD for VS2008 we will target the minimum Officially supported build target,
# if defined __BIG_ENDIAN__ which happens to be Windows XP. */
# define WORDS_BIGENDIAN 1 #if defined(_MSC_VER) && (_MSC_VER >= 1500)
# endif # define VS2008_DEFAULT_TARGET 0x0501
#else
# ifndef WORDS_BIGENDIAN
/* # undef WORDS_BIGENDIAN */
# endif
#endif #endif
/* Define to 1 if OS is AIX. */ /* VS2008 default target settings and minimum build target check */
#ifndef _ALL_SOURCE #if defined(_MSC_VER) && (_MSC_VER >= 1500)
/* # undef _ALL_SOURCE */ # ifndef _WIN32_WINNT
# define _WIN32_WINNT VS2008_DEFAULT_TARGET
# endif
# ifndef WINVER
# define WINVER VS2008_DEFAULT_TARGET
# endif
# if (_WIN32_WINNT < VS2008_MINIMUM_TARGET) || (WINVER < VS2008_MINIMUM_TARGET)
# error VS2008 does not support Windows build targets prior to Windows 2000
# endif
#endif #endif
/* Number of bits in a file offset, on hosts where this is settable. */ /* When no build target is specified Pelles C 5.00 and later default build
/* #undef _FILE_OFFSET_BITS */ target is Windows Vista. We override default target to be Windows 2000. */
#if defined(__POCC__) && (__POCC__ >= 500)
# ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0500
# endif
# ifndef WINVER
# define WINVER 0x0500
# endif
#endif
/* Define for large files, on AIX-style hosts. */ /* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is
/* #undef _LARGE_FILES */ quite convoluted, compiler dependent and even build target dependent. */
#if defined(HAVE_WS2TCPIP_H)
# if defined(__POCC__)
# define HAVE_FREEADDRINFO 1
# define HAVE_GETADDRINFO 1
# define HAVE_GETNAMEINFO 1
# elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
# define HAVE_FREEADDRINFO 1
# define HAVE_GETADDRINFO 1
# define HAVE_GETNAMEINFO 1
# elif defined(_MSC_VER) && (_MSC_VER >= 1200)
# define HAVE_FREEADDRINFO 1
# define HAVE_GETADDRINFO 1
# define HAVE_GETNAMEINFO 1
# endif
#endif
/* Define to empty if `const' does not conform to ANSI C. */ #if defined(__POCC__)
/* #undef const */ # ifndef _MSC_VER
# error Microsoft extensions /Ze compiler option is required
# endif
# ifndef __POCC__OLDNAMES
# error Compatibility names /Go compiler option is required
# endif
#endif
/* Type to use in place of in_addr_t when system does not provide it. */ /* ---------------------------------------------------------------- */
#define in_addr_t unsigned long /* IPV6 COMPATIBILITY */
/* ---------------------------------------------------------------- */
/* Define this if you have address family AF_INET6 */
#ifdef HAVE_WINSOCK2_H
#define HAVE_AF_INET6 1
#endif
/* Define this if you have protocol family PF_INET6 */
#ifdef HAVE_WINSOCK2_H
#define HAVE_PF_INET6 1
#endif
/* Define this if you have struct in6_addr */
#ifdef HAVE_WS2TCPIP_H
#define HAVE_STRUCT_IN6_ADDR 1
#endif
/* Define this if you have struct sockaddr_in6 */
#ifdef HAVE_WS2TCPIP_H
#define HAVE_STRUCT_SOCKADDR_IN6 1
#endif
/* Define this if you have sockaddr_in6 with scopeid */
#ifdef HAVE_WS2TCPIP_H
#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
#endif
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */
/* the signed version of size_t */ #endif /* __ARES_CONFIG_WIN32_H */
/* #undef ssize_t */

7
deps/uv/src/eio/config_linux.h

@ -3,8 +3,11 @@
#include <linux/version.h> #include <linux/version.h>
#define LINUX_VERSION_CODE_FOR(major, minor, patch) (((major & 255) >> 16) | ((minor & 255) >> 8) | (patch & 255)) #define LINUX_VERSION_CODE_FOR(major, minor, patch) \
#define LINUX_VERSION_AT_LEAST(major, minor, patch) (LINUX_VERSION_CODE_FOR(major, minor, patch) >= LINUX_VERSION_CODE) (((major & 255) << 16) | ((minor & 255) << 8) | (patch & 255))
#define LINUX_VERSION_AT_LEAST(major, minor, patch) \
(LINUX_VERSION_CODE >= LINUX_VERSION_CODE_FOR(major, minor, patch))
/* Define to 1 if you have the <dlfcn.h> header file. */ /* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1 #define HAVE_DLFCN_H 1

7
deps/uv/src/ev/config_linux.h

@ -3,8 +3,11 @@
#include <linux/version.h> #include <linux/version.h>
#define LINUX_VERSION_CODE_FOR(major, minor, patch) (((major & 255) >> 16) | ((minor & 255) >> 8) | (patch & 255)) #define LINUX_VERSION_CODE_FOR(major, minor, patch) \
#define LINUX_VERSION_AT_LEAST(major, minor, patch) (LINUX_VERSION_CODE_FOR(major, minor, patch) >= LINUX_VERSION_CODE) (((major & 255) << 16) | ((minor & 255) << 8) | (patch & 255))
#define LINUX_VERSION_AT_LEAST(major, minor, patch) \
(LINUX_VERSION_CODE >= LINUX_VERSION_CODE_FOR(major, minor, patch))
/* Define to 1 if you have the `clock_gettime' function. */ /* Define to 1 if you have the `clock_gettime' function. */
/* #undef HAVE_CLOCK_GETTIME */ /* #undef HAVE_CLOCK_GETTIME */

2
deps/uv/src/uv-common.h

@ -29,6 +29,8 @@
#include "uv.h" #include "uv.h"
#define COUNTOF(a) (sizeof(a) / sizeof(a[0]))
/* /*
* Subclass of uv_handle_t. Used for integration of c-ares. * Subclass of uv_handle_t. Used for integration of c-ares.
*/ */

24
deps/uv/src/uv-freebsd.c

@ -20,28 +20,44 @@
#include "uv.h" #include "uv.h"
#include <string.h>
#include <time.h>
#include <sys/types.h>
#include <sys/sysctl.h>
#undef NANOSEC
#define NANOSEC 1000000000
uint64_t uv_hrtime(void) {
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return (ts.tv_sec * NANOSEC + ts.tv_nsec);
}
int uv_exepath(char* buffer, size_t* size) { int uv_exepath(char* buffer, size_t* size) {
uint32_t usize; uint32_t usize;
int result; int result;
char* path; char* path;
char* fullpath; char* fullpath;
int mib[4];
size_t cb;
if (!buffer || !size) { if (!buffer || !size) {
return -1; return -1;
} }
int mib[4];
mib[0] = CTL_KERN; mib[0] = CTL_KERN;
mib[1] = KERN_PROC; mib[1] = KERN_PROC;
mib[2] = KERN_PROC_PATHNAME; mib[2] = KERN_PROC_PATHNAME;
mib[3] = -1; mib[3] = -1;
size_t cb = *size; cb = *size;
if (sysctl(mib, 4, buffer, &cb, NULL, 0) < 0) { if (sysctl(mib, 4, buffer, &cb, NULL, 0) < 0) {
*size = 0; *size = 0;
return -1; return -1;
} }
*size = strlen(buffer); *size = strlen(buffer);

6
deps/uv/src/uv-linux.c

@ -22,6 +22,7 @@
#include <stdint.h> #include <stdint.h>
#include <stddef.h> #include <stddef.h>
#include <unistd.h>
#include <time.h> #include <time.h>
#undef NANOSEC #undef NANOSEC
@ -39,11 +40,6 @@ uint64_t uv_hrtime() {
int uv_exepath(char* buffer, size_t* size) { int uv_exepath(char* buffer, size_t* size) {
uint32_t usize;
int result;
char* path;
char* fullpath;
if (!buffer || !size) { if (!buffer || !size) {
return -1; return -1;
} }

3
deps/uv/src/uv-sunos.c

@ -20,7 +20,6 @@
#include "uv.h" #include "uv.h"
#include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
#include <unistd.h> #include <unistd.h>
@ -40,7 +39,7 @@ uint64_t uv_hrtime() {
int uv_exepath(char* buffer, size_t* size) { int uv_exepath(char* buffer, size_t* size) {
size_t res; size_t res;
pid_t pid; pid_t pid;
char buf[PATH_MAX]; char buf[128];
if (buffer == NULL) if (buffer == NULL)
return (-1); return (-1);

63
deps/uv/src/uv-unix.c

@ -99,7 +99,6 @@ static void uv_fatal_error(const int errorno, const char* syscall) {
fprintf(stderr, "\nlibuv fatal error. (%d) %s\n", errorno, errmsg); fprintf(stderr, "\nlibuv fatal error. (%d) %s\n", errorno, errmsg);
} }
*((char*)NULL) = 0xff; /* Force debug break */
abort(); abort();
} }
@ -169,8 +168,8 @@ int uv_close(uv_handle_t* handle, uv_close_cb close_cb) {
switch (handle->type) { switch (handle->type) {
case UV_TCP: case UV_TCP:
tcp = (uv_tcp_t*) handle; tcp = (uv_tcp_t*) handle;
uv_read_stop((uv_stream_t*)tcp);
ev_io_stop(EV_DEFAULT_ &tcp->write_watcher); ev_io_stop(EV_DEFAULT_ &tcp->write_watcher);
ev_io_stop(EV_DEFAULT_ &tcp->read_watcher);
break; break;
case UV_PREPARE: case UV_PREPARE:
@ -633,7 +632,7 @@ static uv_req_t* uv__write(uv_tcp_t* tcp) {
/* Successful write */ /* Successful write */
/* Update the counters. */ /* Update the counters. */
while (n > 0) { while (n >= 0) {
uv_buf_t* buf = &(req->bufs[req->write_index]); uv_buf_t* buf = &(req->bufs[req->write_index]);
size_t len = buf->len; size_t len = buf->len;
@ -871,7 +870,7 @@ static void uv__tcp_connect(uv_tcp_t* tcp) {
return; return;
} else { } else {
/* Error */ /* Error */
uv_err_t err = uv_err_new((uv_handle_t*)tcp, error); uv_err_new((uv_handle_t*)tcp, error);
tcp->connect_req = NULL; tcp->connect_req = NULL;
@ -962,6 +961,27 @@ int uv_tcp_connect6(uv_req_t* req, struct sockaddr_in6 addr) {
} }
int uv_getsockname(uv_tcp_t* handle, struct sockaddr* name, int* namelen) {
socklen_t socklen;
int saved_errno;
/* Don't clobber errno. */
saved_errno = errno;
/* sizeof(socklen_t) != sizeof(int) on some systems. */
socklen = (socklen_t)*namelen;
if (getsockname(handle->fd, name, &socklen) == -1) {
uv_err_new((uv_handle_t*)handle, errno);
} else {
*namelen = (int)socklen;
}
errno = saved_errno;
return 0;
}
static size_t uv__buf_count(uv_buf_t bufs[], int bufcnt) { static size_t uv__buf_count(uv_buf_t bufs[], int bufcnt) {
size_t total = 0; size_t total = 0;
int i; int i;
@ -996,7 +1016,9 @@ int uv_write(uv_req_t* req, uv_buf_t bufs[], int bufcnt) {
memcpy(req->bufs, bufs, bufcnt * sizeof(uv_buf_t)); memcpy(req->bufs, bufs, bufcnt * sizeof(uv_buf_t));
req->bufcnt = bufcnt; req->bufcnt = bufcnt;
// fprintf(stderr, "cnt: %d bufs: %p bufsml: %p\n", bufcnt, req->bufs, req->bufsml); /*
* fprintf(stderr, "cnt: %d bufs: %p bufsml: %p\n", bufcnt, req->bufs, req->bufsml);
*/
req->write_index = 0; req->write_index = 0;
tcp->write_queue_size += uv__buf_count(bufs, bufcnt); tcp->write_queue_size += uv__buf_count(bufs, bufcnt);
@ -1096,7 +1118,7 @@ int uv_read_stop(uv_stream_t* stream) {
} }
void uv_req_init(uv_req_t* req, uv_handle_t* handle, void* cb) { void uv_req_init(uv_req_t* req, uv_handle_t* handle, void *(*cb)(void *)) {
uv_counters()->req_init++; uv_counters()->req_init++;
req->type = UV_UNKNOWN_REQ; req->type = UV_UNKNOWN_REQ;
req->cb = cb; req->cb = cb;
@ -1166,7 +1188,7 @@ static void uv__check(EV_P_ ev_check* w, int revents) {
int uv_check_init(uv_check_t* check) { int uv_check_init(uv_check_t* check) {
uv__handle_init((uv_handle_t*)check, UV_CHECK); uv__handle_init((uv_handle_t*)check, UV_CHECK);
uv_counters()->check_init; uv_counters()->check_init++;
ev_check_init(&check->check_watcher, uv__check); ev_check_init(&check->check_watcher, uv__check);
check->check_watcher.data = check; check->check_watcher.data = check;
@ -1303,6 +1325,7 @@ int uv_async_init(uv_async_t* async, uv_async_cb async_cb) {
int uv_async_send(uv_async_t* async) { int uv_async_send(uv_async_t* async) {
ev_async_send(EV_DEFAULT_UC_ &async->async_watcher); ev_async_send(EV_DEFAULT_UC_ &async->async_watcher);
return 0;
} }
@ -1413,6 +1436,8 @@ static uv_ares_task_t* uv__ares_task_create(int fd) {
h->read_watcher.data = h; h->read_watcher.data = h;
h->write_watcher.data = h; h->write_watcher.data = h;
return h;
} }
@ -1544,7 +1569,7 @@ static int getaddrinfo_thread_proc(eio_req *req) {
handle->retcode = getaddrinfo(handle->hostname, handle->retcode = getaddrinfo(handle->hostname,
handle->service, handle->service,
&handle->hints, handle->hints,
&handle->res); &handle->res);
return 0; return 0;
} }
@ -1556,6 +1581,7 @@ int uv_getaddrinfo(uv_getaddrinfo_t* handle,
const char* hostname, const char* hostname,
const char* service, const char* service,
const struct addrinfo* hints) { const struct addrinfo* hints) {
eio_req* req;
uv_eio_init(); uv_eio_init();
if (handle == NULL || cb == NULL || if (handle == NULL || cb == NULL ||
@ -1584,7 +1610,7 @@ int uv_getaddrinfo(uv_getaddrinfo_t* handle,
uv_ref(); uv_ref();
eio_req* req = eio_custom(getaddrinfo_thread_proc, EIO_PRI_DEFAULT, req = eio_custom(getaddrinfo_thread_proc, EIO_PRI_DEFAULT,
uv_getaddrinfo_done, handle); uv_getaddrinfo_done, handle);
assert(req); assert(req);
assert(req->data == handle); assert(req->data == handle);
@ -1592,3 +1618,22 @@ int uv_getaddrinfo(uv_getaddrinfo_t* handle,
return 0; return 0;
} }
int uv_pipe_init(uv_pipe_t* handle) {
assert(0 && "implement me");
}
int uv_pipe_bind(uv_pipe_t* handle, const char* name) {
assert(0 && "implement me");
}
int uv_pipe_listen(uv_pipe_t* handle, uv_connection_cb cb) {
assert(0 && "implement me");
}
int uv_pipe_connect(uv_req_t* req, const char* name) {
assert(0 && "implement me");
}

1146
deps/uv/src/uv-win.c

File diff suppressed because it is too large

28
deps/uv/test/benchmark-list.h

@ -21,25 +21,35 @@
BENCHMARK_DECLARE (sizes) BENCHMARK_DECLARE (sizes)
BENCHMARK_DECLARE (ping_pongs) BENCHMARK_DECLARE (ping_pongs)
BENCHMARK_DECLARE (pump100_client) BENCHMARK_DECLARE (tcp_pump100_client)
BENCHMARK_DECLARE (pump1_client) BENCHMARK_DECLARE (tcp_pump1_client)
BENCHMARK_DECLARE (pipe_pump100_client)
BENCHMARK_DECLARE (pipe_pump1_client)
BENCHMARK_DECLARE (gethostbyname) BENCHMARK_DECLARE (gethostbyname)
BENCHMARK_DECLARE (getaddrinfo) BENCHMARK_DECLARE (getaddrinfo)
HELPER_DECLARE (pump_server) HELPER_DECLARE (tcp_pump_server)
HELPER_DECLARE (echo_server) HELPER_DECLARE (pipe_pump_server)
HELPER_DECLARE (tcp4_echo_server)
HELPER_DECLARE (pipe_echo_server)
HELPER_DECLARE (dns_server) HELPER_DECLARE (dns_server)
TASK_LIST_START TASK_LIST_START
BENCHMARK_ENTRY (sizes) BENCHMARK_ENTRY (sizes)
BENCHMARK_ENTRY (ping_pongs) BENCHMARK_ENTRY (ping_pongs)
BENCHMARK_HELPER (ping_pongs, echo_server) BENCHMARK_HELPER (ping_pongs, tcp4_echo_server)
BENCHMARK_ENTRY (pump100_client) BENCHMARK_ENTRY (tcp_pump100_client)
BENCHMARK_HELPER (pump100_client, pump_server) BENCHMARK_HELPER (tcp_pump100_client, tcp_pump_server)
BENCHMARK_ENTRY (pump1_client) BENCHMARK_ENTRY (tcp_pump1_client)
BENCHMARK_HELPER (pump1_client, pump_server) BENCHMARK_HELPER (tcp_pump1_client, tcp_pump_server)
BENCHMARK_ENTRY (pipe_pump100_client)
BENCHMARK_HELPER (pipe_pump100_client, pipe_pump_server)
BENCHMARK_ENTRY (pipe_pump1_client)
BENCHMARK_HELPER (pipe_pump1_client, pipe_pump_server)
BENCHMARK_ENTRY (gethostbyname) BENCHMARK_ENTRY (gethostbyname)
BENCHMARK_HELPER (gethostbyname, dns_server) BENCHMARK_HELPER (gethostbyname, dns_server)

158
deps/uv/test/benchmark-pump.c

@ -45,7 +45,9 @@ static uv_buf_t buf_alloc(uv_stream_t*, size_t size);
static void buf_free(uv_buf_t uv_buf_t); static void buf_free(uv_buf_t uv_buf_t);
static uv_tcp_t server; static uv_tcp_t tcpServer;
static uv_pipe_t pipeServer;
static uv_handle_t* server;
static struct sockaddr_in listen_addr; static struct sockaddr_in listen_addr;
static struct sockaddr_in connect_addr; static struct sockaddr_in connect_addr;
@ -68,7 +70,10 @@ static char write_buffer[WRITE_BUFFER_SIZE];
/* Make this as large as you need. */ /* Make this as large as you need. */
#define MAX_WRITE_HANDLES 1000 #define MAX_WRITE_HANDLES 1000
static uv_tcp_t write_handles[MAX_WRITE_HANDLES]; static stream_type type;
static uv_tcp_t tcp_write_handles[MAX_WRITE_HANDLES];
static uv_pipe_t pipe_write_handles[MAX_WRITE_HANDLES];
static uv_timer_t timer_handle; static uv_timer_t timer_handle;
@ -81,6 +86,7 @@ static double gbit(int64_t bytes, int64_t passed_ms) {
static void show_stats(uv_timer_t* handle, int status) { static void show_stats(uv_timer_t* handle, int status) {
int64_t diff; int64_t diff;
int i;
#if PRINT_STATS #if PRINT_STATS
LOGF("connections: %d, write: %.1f gbit/s\n", LOGF("connections: %d, write: %.1f gbit/s\n",
@ -94,9 +100,13 @@ static void show_stats(uv_timer_t* handle, int status) {
uv_update_time(); uv_update_time();
diff = uv_now() - start_time; diff = uv_now() - start_time;
LOGF("pump%d_client: %.1f gbit/s\n", write_sockets, LOGF("%s_pump%d_client: %.1f gbit/s\n", type == TCP ? "tcp" : "pipe", write_sockets,
gbit(nsent_total, diff)); gbit(nsent_total, diff));
for (i = 0; i < write_sockets; i++) {
uv_close(type == TCP ? (uv_handle_t*)&tcp_write_handles[i] : (uv_handle_t*)&pipe_write_handles[i], NULL);
}
exit(0); exit(0);
} }
@ -112,7 +122,7 @@ static void read_show_stats() {
uv_update_time(); uv_update_time();
diff = uv_now() - start_time; diff = uv_now() - start_time;
LOGF("pump%d_server: %.1f gbit/s\n", max_read_sockets, LOGF("%s_pump%d_server: %.1f gbit/s\n", type == TCP ? "tcp" : "pipe", max_read_sockets,
gbit(nrecv_total, diff)); gbit(nrecv_total, diff));
} }
@ -133,7 +143,7 @@ void read_sockets_close_cb(uv_handle_t* handle) {
*/ */
if (uv_now() - start_time > 1000 && read_sockets == 0) { if (uv_now() - start_time > 1000 && read_sockets == 0) {
read_show_stats(); read_show_stats();
uv_close((uv_handle_t*)&server, NULL); uv_close(server, NULL);
} }
} }
@ -154,7 +164,7 @@ static void start_stats_collection() {
} }
static void read_cb(uv_stream_t* tcp, ssize_t bytes, uv_buf_t buf) { static void read_cb(uv_stream_t* stream, ssize_t bytes, uv_buf_t buf) {
if (nrecv_total == 0) { if (nrecv_total == 0) {
ASSERT(start_time == 0); ASSERT(start_time == 0);
uv_update_time(); uv_update_time();
@ -162,7 +172,7 @@ static void read_cb(uv_stream_t* tcp, ssize_t bytes, uv_buf_t buf) {
} }
if (bytes < 0) { if (bytes < 0) {
uv_close((uv_handle_t*)tcp, read_sockets_close_cb); uv_close((uv_handle_t*)stream, read_sockets_close_cb);
return; return;
} }
@ -187,7 +197,7 @@ static void write_cb(uv_req_t *req, int status) {
} }
static void do_write(uv_stream_t* tcp) { static void do_write(uv_stream_t* stream) {
uv_req_t* req; uv_req_t* req;
uv_buf_t buf; uv_buf_t buf;
int r; int r;
@ -195,9 +205,9 @@ static void do_write(uv_stream_t* tcp) {
buf.base = (char*) &write_buffer; buf.base = (char*) &write_buffer;
buf.len = sizeof write_buffer; buf.len = sizeof write_buffer;
while (tcp->write_queue_size == 0) { while (stream->write_queue_size == 0) {
req = req_alloc(); req = req_alloc();
uv_req_init(req, (uv_handle_t*)tcp, write_cb); uv_req_init(req, (uv_handle_t*)stream, write_cb);
r = uv_write(req, &buf, 1); r = uv_write(req, &buf, 1);
ASSERT(r == 0); ASSERT(r == 0);
@ -221,7 +231,7 @@ static void connect_cb(uv_req_t* req, int status) {
/* Yay! start writing */ /* Yay! start writing */
for (i = 0; i < write_sockets; i++) { for (i = 0; i < write_sockets; i++) {
do_write((uv_stream_t*)&write_handles[i]); do_write(type == TCP ? (uv_stream_t*)&tcp_write_handles[i] : (uv_stream_t*)&pipe_write_handles[i]);
} }
} }
} }
@ -230,38 +240,62 @@ static void connect_cb(uv_req_t* req, int status) {
static void maybe_connect_some() { static void maybe_connect_some() {
uv_req_t* req; uv_req_t* req;
uv_tcp_t* tcp; uv_tcp_t* tcp;
uv_pipe_t* pipe;
int r; int r;
while (max_connect_socket < TARGET_CONNECTIONS && while (max_connect_socket < TARGET_CONNECTIONS &&
max_connect_socket < write_sockets + MAX_SIMULTANEOUS_CONNECTS) { max_connect_socket < write_sockets + MAX_SIMULTANEOUS_CONNECTS) {
tcp = &write_handles[max_connect_socket++]; if (type == TCP) {
tcp = &tcp_write_handles[max_connect_socket++];
r = uv_tcp_init(tcp);
ASSERT(r == 0); r = uv_tcp_init(tcp);
ASSERT(r == 0);
req = req_alloc();
uv_req_init(req, (uv_handle_t*)tcp, connect_cb); req = req_alloc();
r = uv_tcp_connect(req, connect_addr); uv_req_init(req, (uv_handle_t*)tcp, connect_cb);
ASSERT(r == 0); r = uv_tcp_connect(req, connect_addr);
ASSERT(r == 0);
} else {
pipe = &pipe_write_handles[max_connect_socket++];
r = uv_pipe_init(pipe);
ASSERT(r == 0);
req = req_alloc();
uv_req_init(req, (uv_handle_t*)pipe, connect_cb);
r = uv_pipe_connect(req, TEST_PIPENAME);
ASSERT(r == 0);
#ifdef _WIN32
/* HACK: This is temporary to give the pipes server enough time to create new handles.
* This will go away once uv_pipe_connect can deal with UV_EBUSY.
*/
Sleep(1);
#endif
}
} }
} }
static void connection_cb(uv_handle_t* s, int status) { static void connection_cb(uv_handle_t* s, int status) {
uv_tcp_t* tcp; uv_stream_t* stream;
int r; int r;
ASSERT(&server == (uv_tcp_t*)s); ASSERT(server == s);
ASSERT(status == 0); ASSERT(status == 0);
tcp = malloc(sizeof(uv_tcp_t)); if (type == TCP) {
stream = (uv_stream_t*)malloc(sizeof(uv_tcp_t));
uv_tcp_init(tcp); uv_tcp_init((uv_tcp_t*)stream);
} else {
stream = (uv_stream_t*)malloc(sizeof(uv_pipe_t));
uv_pipe_init((uv_pipe_t*)stream);
}
r = uv_accept(s, (uv_stream_t*)tcp); r = uv_accept(s, stream);
ASSERT(r == 0); ASSERT(r == 0);
r = uv_read_start((uv_stream_t*)tcp, buf_alloc, read_cb); r = uv_read_start(stream, buf_alloc, read_cb);
ASSERT(r == 0); ASSERT(r == 0);
read_sockets++; read_sockets++;
@ -317,7 +351,7 @@ typedef struct buf_list_s {
static buf_list_t* buf_freelist = NULL; static buf_list_t* buf_freelist = NULL;
static uv_buf_t buf_alloc(uv_stream_t* tcp, size_t size) { static uv_buf_t buf_alloc(uv_stream_t* stream, size_t size) {
buf_list_t* buf; buf_list_t* buf;
buf = buf_freelist; buf = buf_freelist;
@ -342,18 +376,41 @@ static void buf_free(uv_buf_t uv_buf_t) {
} }
HELPER_IMPL(pump_server) { HELPER_IMPL(tcp_pump_server) {
int r; int r;
type = TCP;
uv_init(); uv_init();
listen_addr = uv_ip4_addr("0.0.0.0", TEST_PORT); listen_addr = uv_ip4_addr("0.0.0.0", TEST_PORT);
/* Server */ /* Server */
r = uv_tcp_init(&server); server = (uv_handle_t*)&tcpServer;
r = uv_tcp_init(&tcpServer);
ASSERT(r == 0);
r = uv_tcp_bind(&tcpServer, listen_addr);
ASSERT(r == 0);
r = uv_tcp_listen(&tcpServer, MAX_WRITE_HANDLES, connection_cb);
ASSERT(r == 0);
uv_run();
return 0;
}
HELPER_IMPL(pipe_pump_server) {
int r;
type = PIPE;
uv_init();
/* Server */
server = (uv_handle_t*)&pipeServer;
r = uv_pipe_init(&pipeServer);
ASSERT(r == 0); ASSERT(r == 0);
r = uv_tcp_bind(&server, listen_addr); r = uv_pipe_bind(&pipeServer, TEST_PIPENAME);
ASSERT(r == 0); ASSERT(r == 0);
r = uv_tcp_listen(&server, MAX_WRITE_HANDLES, connection_cb); r = uv_pipe_listen(&pipeServer, connection_cb);
ASSERT(r == 0); ASSERT(r == 0);
uv_run(); uv_run();
@ -362,9 +419,10 @@ HELPER_IMPL(pump_server) {
} }
void pump(int n) { void tcp_pump(int n) {
ASSERT(n <= MAX_WRITE_HANDLES); ASSERT(n <= MAX_WRITE_HANDLES);
TARGET_CONNECTIONS = n; TARGET_CONNECTIONS = n;
type = TCP;
uv_init(); uv_init();
@ -377,13 +435,39 @@ void pump(int n) {
} }
BENCHMARK_IMPL(pump100_client) { void pipe_pump(int n) {
pump(100); ASSERT(n <= MAX_WRITE_HANDLES);
TARGET_CONNECTIONS = n;
type = PIPE;
uv_init();
/* Start making connections */
maybe_connect_some();
uv_run();
}
BENCHMARK_IMPL(tcp_pump100_client) {
tcp_pump(100);
return 0;
}
BENCHMARK_IMPL(tcp_pump1_client) {
tcp_pump(1);
return 0;
}
BENCHMARK_IMPL(pipe_pump100_client) {
pipe_pump(100);
return 0; return 0;
} }
BENCHMARK_IMPL(pump1_client) { BENCHMARK_IMPL(pipe_pump1_client) {
pump(1); pipe_pump(1);
return 0; return 0;
} }

1
deps/uv/test/benchmark-sizes.c

@ -26,6 +26,7 @@
BENCHMARK_IMPL(sizes) { BENCHMARK_IMPL(sizes) {
LOGF("uv_req_t: %u bytes\n", (unsigned int) sizeof(uv_req_t)); LOGF("uv_req_t: %u bytes\n", (unsigned int) sizeof(uv_req_t));
LOGF("uv_tcp_t: %u bytes\n", (unsigned int) sizeof(uv_tcp_t)); LOGF("uv_tcp_t: %u bytes\n", (unsigned int) sizeof(uv_tcp_t));
LOGF("uv_pipe_t: %u bytes\n", (unsigned int) sizeof(uv_pipe_t));
LOGF("uv_prepare_t: %u bytes\n", (unsigned int) sizeof(uv_prepare_t)); LOGF("uv_prepare_t: %u bytes\n", (unsigned int) sizeof(uv_prepare_t));
LOGF("uv_check_t: %u bytes\n", (unsigned int) sizeof(uv_check_t)); LOGF("uv_check_t: %u bytes\n", (unsigned int) sizeof(uv_check_t));
LOGF("uv_idle_t: %u bytes\n", (unsigned int) sizeof(uv_idle_t)); LOGF("uv_idle_t: %u bytes\n", (unsigned int) sizeof(uv_idle_t));

2
deps/uv/test/dns-server.c

@ -165,7 +165,7 @@ static void process_req(uv_stream_t* handle, ssize_t nread, uv_buf_t buf) {
rec_remaining = ntohs(reclen_n) - (DNSREC_LEN - 2); rec_remaining = ntohs(reclen_n) - (DNSREC_LEN - 2);
} }
} }
if (rec_remaining <= readbuf_remaining) { if (rec_remaining <= readbuf_remaining) {
/* prepare reply */ /* prepare reply */
addrsp(wr, hdrbuf); addrsp(wr, hdrbuf);

123
deps/uv/test/echo-server.c

@ -24,19 +24,16 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
typedef struct { typedef struct {
uv_req_t req; uv_req_t req;
uv_buf_t buf; uv_buf_t buf;
} write_req_t; } write_req_t;
static int server_closed; static int server_closed;
static uv_tcp_t server; static stream_type serverType;
static uv_tcp_t tcpServer;
static int server6_closed; static uv_pipe_t pipeServer;
static uv_tcp_t server6; static uv_handle_t* server;
static void after_write(uv_req_t* req, int status); static void after_write(uv_req_t* req, int status);
static void after_read(uv_stream_t*, ssize_t nread, uv_buf_t buf); static void after_read(uv_stream_t*, ssize_t nread, uv_buf_t buf);
@ -82,7 +79,7 @@ static void after_read(uv_stream_t* handle, ssize_t nread, uv_buf_t buf) {
} }
req = (uv_req_t*) malloc(sizeof *req); req = (uv_req_t*) malloc(sizeof *req);
uv_req_init(req, (uv_handle_t*)handle, after_shutdown); uv_req_init(req, (uv_handle_t*)handle, (void *(*)(void *))after_shutdown);
uv_shutdown(req); uv_shutdown(req);
return; return;
@ -98,17 +95,15 @@ static void after_read(uv_stream_t* handle, ssize_t nread, uv_buf_t buf) {
if (!server_closed) { if (!server_closed) {
for (i = 0; i < nread; i++) { for (i = 0; i < nread; i++) {
if (buf.base[i] == 'Q') { if (buf.base[i] == 'Q') {
uv_close((uv_handle_t*)&server, on_server_close); uv_close(server, on_server_close);
server_closed = 1; server_closed = 1;
uv_close((uv_handle_t*)&server6, on_server_close);
server6_closed = 1;
} }
} }
} }
wr = (write_req_t*) malloc(sizeof *wr); wr = (write_req_t*) malloc(sizeof *wr);
uv_req_init(&wr->req, (uv_handle_t*)handle, after_write); uv_req_init(&wr->req, (uv_handle_t*)handle, (void *(*)(void *))after_write);
wr->buf.base = buf.base; wr->buf.base = buf.base;
wr->buf.len = nread; wr->buf.len = nread;
if (uv_write(&wr->req, &wr->buf, 1)) { if (uv_write(&wr->req, &wr->buf, 1)) {
@ -131,18 +126,25 @@ static uv_buf_t echo_alloc(uv_stream_t* handle, size_t suggested_size) {
static void on_connection(uv_handle_t* server, int status) { static void on_connection(uv_handle_t* server, int status) {
uv_tcp_t* handle; uv_handle_t* handle;
int r; int r;
if (status != 0) { if (status != 0) {
fprintf(stderr, "Connect error %d\n", uv_last_error()); fprintf(stderr, "Connect error %d\n", uv_last_error().code);
} }
ASSERT(status == 0); ASSERT(status == 0);
handle = (uv_tcp_t*) malloc(sizeof *handle); if (serverType == TCP) {
ASSERT(handle != NULL); handle = (uv_handle_t*) malloc(sizeof(uv_tcp_t));
ASSERT(handle != NULL);
uv_tcp_init(handle); uv_tcp_init((uv_tcp_t*)handle);
} else {
handle = (uv_handle_t*) malloc(sizeof(uv_pipe_t));
ASSERT(handle != NULL);
uv_pipe_init((uv_pipe_t*)handle);
}
/* associate server with stream */ /* associate server with stream */
handle->data = server; handle->data = server;
@ -156,37 +158,50 @@ static void on_connection(uv_handle_t* server, int status) {
static void on_server_close(uv_handle_t* handle) { static void on_server_close(uv_handle_t* handle) {
ASSERT(handle == (uv_handle_t*)&server || handle == (uv_handle_t*)&server6); ASSERT(handle == server);
} }
static int echo_start(int port) { static int tcp4_echo_start(int port) {
struct sockaddr_in addr = uv_ip4_addr("0.0.0.0", port); struct sockaddr_in addr = uv_ip4_addr("0.0.0.0", port);
struct sockaddr_in6 addr6 = uv_ip6_addr("::1", port);
int r; int r;
r = uv_tcp_init(&server); server = (uv_handle_t*)&tcpServer;
serverType = TCP;
r = uv_tcp_init(&tcpServer);
if (r) { if (r) {
/* TODO: Error codes */ /* TODO: Error codes */
fprintf(stderr, "Socket creation error\n"); fprintf(stderr, "Socket creation error\n");
return 1; return 1;
} }
r = uv_tcp_bind(&server, addr); r = uv_tcp_bind(&tcpServer, addr);
if (r) { if (r) {
/* TODO: Error codes */ /* TODO: Error codes */
fprintf(stderr, "Bind error\n"); fprintf(stderr, "Bind error\n");
return 1; return 1;
} }
r = uv_tcp_listen(&server, 128, on_connection); r = uv_tcp_listen(&tcpServer, 128, on_connection);
if (r) { if (r) {
/* TODO: Error codes */ /* TODO: Error codes */
fprintf(stderr, "Listen error\n"); fprintf(stderr, "Listen error\n");
return 1; return 1;
} }
r = uv_tcp_init(&server6); return 0;
}
static int tcp6_echo_start(int port) {
struct sockaddr_in6 addr6 = uv_ip6_addr("::1", port);
int r;
server = (uv_handle_t*)&tcpServer;
serverType = TCP;
r = uv_tcp_init(&tcpServer);
if (r) { if (r) {
/* TODO: Error codes */ /* TODO: Error codes */
fprintf(stderr, "Socket creation error\n"); fprintf(stderr, "Socket creation error\n");
@ -194,14 +209,45 @@ static int echo_start(int port) {
} }
/* IPv6 is optional as not all platforms support it */ /* IPv6 is optional as not all platforms support it */
r = uv_tcp_bind6(&server6, addr6); r = uv_tcp_bind6(&tcpServer, addr6);
if (r) { if (r) {
/* show message but return OK */ /* show message but return OK */
fprintf(stderr, "IPv6 not supported\n"); fprintf(stderr, "IPv6 not supported\n");
return 0; return 0;
} }
r = uv_tcp_listen(&server6, 128, on_connection); r = uv_tcp_listen(&tcpServer, 128, on_connection);
if (r) {
/* TODO: Error codes */
fprintf(stderr, "Listen error\n");
return 1;
}
return 0;
}
static int pipe_echo_start(char* pipeName) {
int r;
server = (uv_handle_t*)&pipeServer;
serverType = PIPE;
r = uv_pipe_init(&pipeServer);
if (r) {
/* TODO: Error codes */
fprintf(stderr, "Pipe creation error\n");
return 1;
}
r = uv_pipe_bind(&pipeServer, pipeName);
if (r) {
/* TODO: Error codes */
fprintf(stderr, "create error\n");
return 1;
}
r = uv_pipe_listen(&pipeServer, on_connection);
if (r) { if (r) {
/* TODO: Error codes */ /* TODO: Error codes */
fprintf(stderr, "Listen error on IPv6\n"); fprintf(stderr, "Listen error on IPv6\n");
@ -212,9 +258,30 @@ static int echo_start(int port) {
} }
HELPER_IMPL(echo_server) { HELPER_IMPL(tcp4_echo_server) {
uv_init();
if (tcp4_echo_start(TEST_PORT))
return 1;
uv_run();
return 0;
}
HELPER_IMPL(tcp6_echo_server) {
uv_init();
if (tcp6_echo_start(TEST_PORT))
return 1;
uv_run();
return 0;
}
HELPER_IMPL(pipe_echo_server) {
uv_init(); uv_init();
if (echo_start(TEST_PORT))
if (pipe_echo_start(TEST_PIPENAME))
return 1; return 1;
uv_run(); uv_run();

26
deps/uv/test/run-benchmarks.c

@ -34,26 +34,14 @@
int main(int argc, char **argv) { int main(int argc, char **argv) {
task_entry_t *task;
platform_init(argc, argv); platform_init(argc, argv);
if (argc > 1) { switch (argc) {
/* A specific process was requested. */ case 1: return run_tests(BENCHMARK_TIMEOUT, 1);
return run_process(argv[1]); case 2: return run_test(argv[1], BENCHMARK_TIMEOUT, 1);
case 3: return run_test_part(argv[1], argv[2]);
} else { default:
/* Run all benchmarks. */ LOGF("Too many arguments.\n");
task = (task_entry_t*)&TASKS; return 1;
for (task = (task_entry_t*)&TASKS; task->main; task++) {
if (task->is_helper) {
continue;
}
run_task(task, BENCHMARK_TIMEOUT, 1);
}
LOG("Done.\n");
return 0;
} }
} }

53
deps/uv/test/run-tests.c

@ -33,54 +33,15 @@
#define TEST_TIMEOUT 5000 #define TEST_TIMEOUT 5000
static void log_progress(int total, int passed, int failed, char* name) {
LOGF("[%% %3d|+ %3d|- %3d]: %s", (passed + failed) / total * 100,
passed, failed, name);
}
int main(int argc, char **argv) { int main(int argc, char **argv) {
int total, passed, failed;
task_entry_t* task;
platform_init(argc, argv); platform_init(argc, argv);
if (argc > 1) { switch (argc) {
/* A specific process was requested. */ case 1: return run_tests(TEST_TIMEOUT, 0);
return run_process(argv[1]); case 2: return run_test(argv[1], TEST_TIMEOUT, 0);
case 3: return run_test_part(argv[1], argv[2]);
} else { default:
/* Count the number of tests. */ LOGF("Too many arguments.\n");
total = 0; return 1;
task = (task_entry_t*)&TASKS;
for (task = (task_entry_t*)&TASKS; task->main; task++) {
if (!task->is_helper) {
total++;
}
}
/* Run all tests. */
passed = 0;
failed = 0;
task = (task_entry_t*)&TASKS;
for (task = (task_entry_t*)&TASKS; task->main; task++) {
if (task->is_helper) {
continue;
}
rewind_cursor();
log_progress(total, passed, failed, task->task_name);
if (run_task(task, TEST_TIMEOUT, 0)) {
passed++;
} else {
failed++;
}
}
rewind_cursor();
log_progress(total, passed, failed, "Done.\n");
return 0;
} }
} }

8
deps/uv/test/runner-unix.c

@ -68,9 +68,9 @@ void platform_init(int argc, char **argv) {
} }
/* Invoke "arv[0] test-name". Store process info in *p. */ /* Invoke "argv[0] test-name [test-part]". Store process info in *p. */
/* Make sure that all stdio output of the processes is buffered up. */ /* Make sure that all stdio output of the processes is buffered up. */
int process_start(char* name, process_info_t* p) { int process_start(char* name, char* part, process_info_t* p) {
FILE* stdout_file = tmpfile(); FILE* stdout_file = tmpfile();
if (!stdout_file) { if (!stdout_file) {
perror("tmpfile"); perror("tmpfile");
@ -92,7 +92,7 @@ int process_start(char* name, process_info_t* p) {
dup2(fileno(stdout_file), STDOUT_FILENO); dup2(fileno(stdout_file), STDOUT_FILENO);
dup2(fileno(stdout_file), STDERR_FILENO); dup2(fileno(stdout_file), STDERR_FILENO);
char* args[3] = { executable_path, name, NULL }; char* args[] = { executable_path, name, part, NULL };
execvp(executable_path, args); execvp(executable_path, args);
perror("execvp()"); perror("execvp()");
_exit(127); _exit(127);
@ -248,7 +248,7 @@ int process_copy_output(process_info_t *p, int fd) {
return -1; return -1;
} }
size_t nread, nwritten; ssize_t nread, nwritten;
char buf[1024]; char buf[1024];
while ((nread = read(fileno(p->stdout_file), buf, 1024)) > 0) { while ((nread = read(fileno(p->stdout_file), buf, 1024)) > 0) {

26
deps/uv/test/runner-win.c

@ -52,7 +52,7 @@ void platform_init(int argc, char **argv) {
} }
int process_start(char *name, process_info_t *p) { int process_start(char *name, char *part, process_info_t *p) {
HANDLE file = INVALID_HANDLE_VALUE; HANDLE file = INVALID_HANDLE_VALUE;
HANDLE nul = INVALID_HANDLE_VALUE; HANDLE nul = INVALID_HANDLE_VALUE;
WCHAR path[MAX_PATH], filename[MAX_PATH]; WCHAR path[MAX_PATH], filename[MAX_PATH];
@ -97,12 +97,24 @@ int process_start(char *name, process_info_t *p) {
if (result == 0 || result == sizeof(image)) if (result == 0 || result == sizeof(image))
goto error; goto error;
if (_snwprintf((wchar_t*)&args, if (part) {
sizeof(args) / sizeof(wchar_t), if (_snwprintf((wchar_t*)args,
L"\"%s\" %S", sizeof(args) / sizeof(wchar_t),
image, L"\"%s\" %S %S",
name) < 0) image,
goto error; name,
part) < 0) {
goto error;
}
} else {
if (_snwprintf((wchar_t*)args,
sizeof(args) / sizeof(wchar_t),
L"\"%s\" %S",
image,
name) < 0) {
goto error;
}
}
memset((void*)&si, 0, sizeof(si)); memset((void*)&si, 0, sizeof(si));
si.cb = sizeof(si); si.cb = sizeof(si);

211
deps/uv/test/runner.c

@ -26,102 +26,155 @@
char executable_path[PATHMAX] = { '\0' }; char executable_path[PATHMAX] = { '\0' };
/* Start a specific process declared by TEST_ENTRY or TEST_HELPER. */
/* Returns the exit code of the specific process. */ static void log_progress(int total, int passed, int failed, const char* name) {
int run_process(char* name) { LOGF("[%% %3d|+ %3d|- %3d]: %s", (passed + failed) / total * 100,
task_entry_t *test; passed, failed, name);
}
for (test = (task_entry_t*)&TASKS; test->main; test++) {
if (strcmp(name, test->process_name) == 0) {
return test->main(); int run_tests(int timeout, int benchmark_output) {
int total, passed, failed;
task_entry_t* task;
/* Count the number of tests. */
total = 0;
for (task = TASKS; task->main; task++) {
if (!task->is_helper) {
total++;
} }
} }
LOGF("Test process %s not found!\n", name); /* Run all tests. */
return 255; passed = 0;
failed = 0;
for (task = TASKS; task->main; task++) {
if (task->is_helper) {
continue;
}
rewind_cursor();
log_progress(total, passed, failed, task->task_name);
if (run_test(task->task_name, timeout, benchmark_output) == 0) {
passed++;
} else {
failed++;
}
}
rewind_cursor();
log_progress(total, passed, failed, "Done.\n");
return 0;
} }
/* int run_test(const char* test, int timeout, int benchmark_output) {
* Runs all processes associated with a particular test or benchmark. char errmsg[1024] = "no error";
* It returns 1 if the test succeeded, 0 if it failed. process_info_t processes[1024];
* If the test fails it prints diagnostic information. process_info_t *main_proc;
* If benchmark_output is nonzero, the output from the main process is task_entry_t* task;
* always shown.
*/
int run_task(task_entry_t *test, int timeout, int benchmark_output) {
int i, result, success;
char errmsg[256];
task_entry_t *helper;
int process_count; int process_count;
process_info_t processes[MAX_PROCESSES]; int result;
process_info_t *main_process; int status;
int i;
success = 0;
status = 255;
process_count = 0; process_count = 0;
/* Start all helpers for this test first. */ /* Start the helpers first. */
for (helper = (task_entry_t*)&TASKS; helper->main; helper++) { for (task = TASKS; task->main; task++) {
if (helper->is_helper && if (strcmp(test, task->task_name) != 0) {
strcmp(test->task_name, helper->task_name) == 0) { continue;
if (process_start(helper->process_name, &processes[process_count]) == -1) { }
snprintf((char*)&errmsg,
sizeof(errmsg), /* Skip the test itself. */
"process `%s` failed to start.", if (!task->is_helper) {
helper->process_name); continue;
goto finalize; }
}
process_count++; if (process_start(task->task_name,
task->process_name,
&processes[process_count]) == -1) {
snprintf(errmsg,
sizeof errmsg,
"Process `%s` failed to start.",
task->process_name);
goto out;
} }
process_count++;
} }
/* Wait a little bit to allow servers to start. Racy. */ /* Give the helpers time to settle. Race-y, fix this. */
uv_sleep(100); uv_sleep(250);
/* Now start the test itself. */
for (main_proc = NULL, task = TASKS; task->main; task++) {
if (strcmp(test, task->task_name) != 0) {
continue;
}
if (task->is_helper) {
continue;
}
if (process_start(task->task_name,
task->process_name,
&processes[process_count]) == -1) {
snprintf(errmsg,
sizeof errmsg,
"Process `%s` failed to start.",
task->process_name);
goto out;
}
/* Start the main test process. */ main_proc = &processes[process_count];
if (process_start(test->process_name, &processes[process_count]) == -1) { process_count++;
snprintf((char*)&errmsg, sizeof(errmsg), "process `%s` failed to start.", break;
test->process_name);
goto finalize;
} }
main_process = &processes[process_count];
process_count++;
/* Wait for the main process to terminate. */ if (main_proc == NULL) {
result = process_wait(main_process, 1, timeout); snprintf(errmsg,
sizeof errmsg,
"No test with that name: %s",
test);
goto out;
}
result = process_wait(main_proc, 1, timeout);
if (result == -1) { if (result == -1) {
FATAL("process_wait failed"); FATAL("process_wait failed");
} else if (result == -2) { } else if (result == -2) {
snprintf((char*)&errmsg, sizeof(errmsg), "timeout."); /* Don't have to clean up the process, process_wait() has killed it. */
goto finalize; snprintf(errmsg,
sizeof errmsg,
"timeout");
goto out;
} }
/* Reap the main process. */ status = process_reap(main_proc);
result = process_reap(main_process); if (status != 0) {
if (result != 0) { snprintf(errmsg,
snprintf((char*)&errmsg, sizeof(errmsg), "exit code %d.", result); sizeof errmsg,
goto finalize; "exit code %d",
status);
} }
/* Yes! did it. */ out:
success = 1; /* Reap running processes except the main process, it's already dead. */
for (i = 0; i < process_count - 1; i++) {
finalize:
/* Kill all (helper) processes that are still running. */
for (i = 0; i < process_count; i++) {
/* If terminate fails the process is probably already closed. */
process_terminate(&processes[i]); process_terminate(&processes[i]);
} }
/* Wait until all processes have really terminated. */ if (process_wait(processes, process_count - 1, -1) < 0) {
if (process_wait((process_info_t*)&processes, process_count, -1) < 0) {
FATAL("process_wait failed"); FATAL("process_wait failed");
} }
/* Show error and output from processes if the test failed. */ /* Show error and output from processes if the test failed. */
if (!success) { if (status != 0) {
LOGF("\n`%s` failed: %s\n", test->task_name, errmsg); LOGF("\n`%s` failed: %s\n", test, errmsg);
for (i = 0; i < process_count; i++) { for (i = 0; i < process_count; i++) {
switch (process_output_size(&processes[i])) { switch (process_output_size(&processes[i])) {
@ -145,13 +198,13 @@ finalize:
/* In benchmark mode show concise output from the main process. */ /* In benchmark mode show concise output from the main process. */
} else if (benchmark_output) { } else if (benchmark_output) {
switch (process_output_size(main_process)) { switch (process_output_size(main_proc)) {
case -1: case -1:
LOGF("%s: (unavailabe)\n", test->task_name); LOGF("%s: (unavailabe)\n", test);
break; break;
case 0: case 0:
LOGF("%s: (no output)\n", test->task_name); LOGF("%s: (no output)\n", test);
break; break;
default: default:
@ -167,5 +220,23 @@ finalize:
process_cleanup(&processes[i]); process_cleanup(&processes[i]);
} }
return success; return status;
}
/* Returns the status code of the task part
* or 255 if no matching task was not found.
*/
int run_test_part(const char* test, const char* part) {
task_entry_t* task;
for (task = TASKS; task->main; task++) {
if (strcmp(test, task->task_name) == 0
&& strcmp(part, task->process_name) == 0) {
return task->main();
}
}
LOGF("No test part with that name: %s:%s\n", test, part);
return 255;
} }

30
deps/uv/test/runner.h

@ -41,13 +41,6 @@ typedef struct {
} task_entry_t, bench_entry_t; } task_entry_t, bench_entry_t;
/* Runs an individual task; returns 1 if the test succeeded, 0 if it failed. */
/* If the test fails it prints diagnostic information. */
/* If benchmark_output is nonzero, the output from the main process is
/* always shown. */
int run_task(task_entry_t *test, int timeout, int benchmark_output);
/* /*
* Macros used by test-list.h and benchmark-list.h. * Macros used by test-list.h and benchmark-list.h.
*/ */
@ -95,13 +88,20 @@ extern char executable_path[PATHMAX];
/* The array that is filled by test-list.h or benchmark-list.h */ /* The array that is filled by test-list.h or benchmark-list.h */
extern task_entry_t TASKS[]; extern task_entry_t TASKS[];
/* Start a specific process declared by TEST_ENTRY or TEST_HELPER. */ /*
/* Returns the exit code of the specific process. */ * Run all tests.
int run_task(task_entry_t *test, int timeout, int benchmark_output); */
int run_tests(int timeout, int benchmark_output);
/* Start a specific process declared by TEST_ENTRY or TEST_HELPER. */ /*
/* Returns the exit code of the specific process. */ * Run a single test. Starts up any helpers.
int run_process(char* name); */
int run_test(const char* test, int timeout, int benchmark_output);
/*
* Run a test part, i.e. the test or one of its helpers.
*/
int run_test_part(const char* test, const char* part);
/* /*
@ -113,9 +113,9 @@ int run_process(char* name);
/* Do platform-specific initialization. */ /* Do platform-specific initialization. */
void platform_init(); void platform_init();
/* Invoke "arv[0] test-name". Store process info in *p. */ /* Invoke "argv[0] test-name [test-part]". Store process info in *p. */
/* Make sure that all stdio output of the processes is buffered up. */ /* Make sure that all stdio output of the processes is buffered up. */
int process_start(char *name, process_info_t *p); int process_start(char *name, char* part, process_info_t *p);
/* Wait for all `n` processes in `vec` to terminate. */ /* Wait for all `n` processes in `vec` to terminate. */
/* Time out after `timeout` msec, or never if timeout == -1 */ /* Time out after `timeout` msec, or never if timeout == -1 */

11
deps/uv/test/task.h

@ -30,6 +30,17 @@
#define TEST_PORT 9123 #define TEST_PORT 9123
#define TEST_PORT_2 9124 #define TEST_PORT_2 9124
#ifdef _WIN32
# define TEST_PIPENAME "\\\\.\\pipe\\uv-test"
#else
# /* TODO: define unix pipe name */
# define TEST_PIPENAME ""
#endif
typedef enum {
TCP = 0,
PIPE
} stream_type;
/* Log to stderr. */ /* Log to stderr. */
#define LOG(...) fprintf(stderr, "%s", __VA_ARGS__) #define LOG(...) fprintf(stderr, "%s", __VA_ARGS__)

2
deps/uv/test/test-async.c

@ -47,8 +47,6 @@ static uintptr_t thread3_id = 0;
/* Thread 1 makes sure that async1_cb_called reaches 3 before exiting. */ /* Thread 1 makes sure that async1_cb_called reaches 3 before exiting. */
void thread1_entry(void *arg) { void thread1_entry(void *arg) {
int state = 0;
uv_sleep(50); uv_sleep(50);
while (1) { while (1) {

10
deps/uv/test/test-callback-stack.c

@ -70,7 +70,7 @@ static void shutdown_cb(uv_req_t* req, int status) {
static void read_cb(uv_stream_t* tcp, ssize_t nread, uv_buf_t buf) { static void read_cb(uv_stream_t* tcp, ssize_t nread, uv_buf_t buf) {
ASSERT(nested == 0 && "read_cb must be called from a fresh stack"); ASSERT(nested == 0 && "read_cb must be called from a fresh stack");
printf("Read. nread == %d\n", nread); printf("Read. nread == %d\n", (int)nread);
free(buf.base); free(buf.base);
if (nread == 0) { if (nread == 0) {
@ -97,7 +97,7 @@ static void read_cb(uv_stream_t* tcp, ssize_t nread, uv_buf_t buf) {
/* from a fresh stack. */ /* from a fresh stack. */
if (bytes_received == sizeof MESSAGE) { if (bytes_received == sizeof MESSAGE) {
nested++; nested++;
uv_req_init(&shutdown_req, (uv_handle_t*)tcp, shutdown_cb); uv_req_init(&shutdown_req, (uv_handle_t*)tcp, (void *(*)(void *))shutdown_cb);
puts("Shutdown"); puts("Shutdown");
@ -167,7 +167,7 @@ static void connect_cb(uv_req_t* req, int status) {
buf.base = (char*) &MESSAGE; buf.base = (char*) &MESSAGE;
buf.len = sizeof MESSAGE; buf.len = sizeof MESSAGE;
uv_req_init(&write_req, req->handle, write_cb); uv_req_init(&write_req, req->handle, (void *(*)(void *))write_cb);
if (uv_write(&write_req, &buf, 1)) { if (uv_write(&write_req, &buf, 1)) {
FATAL("uv_write failed"); FATAL("uv_write failed");
@ -191,7 +191,9 @@ TEST_IMPL(callback_stack) {
puts("Connecting..."); puts("Connecting...");
nested++; nested++;
uv_req_init(&connect_req, (uv_handle_t*)&client, connect_cb); uv_req_init(&connect_req, (uv_handle_t*)&client,
(void *(*)(void *))connect_cb);
if (uv_tcp_connect(&connect_req, addr)) { if (uv_tcp_connect(&connect_req, addr)) {
FATAL("uv_tcp_connect failed"); FATAL("uv_tcp_connect failed");
} }

2
deps/uv/test/test-connection-fail.c

@ -103,7 +103,7 @@ void connection_fail(uv_connect_cb connect_cb) {
/* We are never doing multiple reads/connects at a time anyway. */ /* We are never doing multiple reads/connects at a time anyway. */
/* so these handles can be pre-initialized. */ /* so these handles can be pre-initialized. */
uv_req_init(&req, (uv_handle_t*)&tcp, connect_cb); uv_req_init(&req, (uv_handle_t*)&tcp, (void *(*)(void *))connect_cb);
uv_tcp_bind(&tcp, client_addr); uv_tcp_bind(&tcp, client_addr);
r = uv_tcp_connect(&req, server_addr); r = uv_tcp_connect(&req, server_addr);

6
deps/uv/test/test-delayed-accept.c

@ -24,8 +24,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
static char BUFFER[1024];
static int connection_cb_called = 0; static int connection_cb_called = 0;
static int do_accept_called = 0; static int do_accept_called = 0;
static int close_cb_called = 0; static int close_cb_called = 0;
@ -52,8 +50,8 @@ static void close_cb(uv_handle_t* handle) {
static void do_accept(uv_timer_t* timer_handle, int status) { static void do_accept(uv_timer_t* timer_handle, int status) {
uv_tcp_t* server; uv_tcp_t* server;
uv_tcp_t* accepted_handle = (uv_tcp_t*)malloc(sizeof *accepted_handle); uv_tcp_t* accepted_handle = (uv_tcp_t*)malloc(sizeof *accepted_handle);
uint64_t tcpcnt;
int r; int r;
int tcpcnt;
ASSERT(timer_handle != NULL); ASSERT(timer_handle != NULL);
ASSERT(status == 0); ASSERT(status == 0);
@ -178,7 +176,7 @@ static void client_connect() {
r = uv_tcp_init(client); r = uv_tcp_init(client);
ASSERT(r == 0); ASSERT(r == 0);
uv_req_init(connect_req, (uv_handle_t*)client, connect_cb); uv_req_init(connect_req, (uv_handle_t*)client, (void *(*)(void *))connect_cb);
r = uv_tcp_connect(connect_req, addr); r = uv_tcp_connect(connect_req, addr);
ASSERT(r == 0); ASSERT(r == 0);
} }

186
deps/uv/test/test-getsockname.c

@ -0,0 +1,186 @@
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#include "uv.h"
#include "task.h"
#include <stdlib.h>
#include <stdio.h>
static int getsocknamecount = 0;
static uv_tcp_t tcp;
static uv_req_t connect_req;
static uv_tcp_t tcpServer;
static uv_buf_t alloc(uv_stream_t* handle, size_t suggested_size) {
uv_buf_t buf;
buf.base = (char*) malloc(suggested_size);
buf.len = suggested_size;
return buf;
}
static void on_close(uv_handle_t* peer) {
free(peer);
uv_close((uv_handle_t*)&tcpServer, NULL);
}
static void after_shutdown(uv_req_t* req, int status) {
uv_close(req->handle, on_close);
free(req);
}
static void after_read(uv_stream_t* handle, ssize_t nread, uv_buf_t buf) {
uv_req_t* req;
if (buf.base) {
free(buf.base);
}
req = (uv_req_t*) malloc(sizeof *req);
uv_req_init(req, (uv_handle_t*)handle, (void *(*)(void *))after_shutdown);
uv_shutdown(req);
}
static void on_connection(uv_handle_t* server, int status) {
struct sockaddr sockname;
int namelen = sizeof(sockname);
uv_handle_t* handle;
int r;
if (status != 0) {
fprintf(stderr, "Connect error %d\n", uv_last_error().code);
}
ASSERT(status == 0);
handle = (uv_handle_t*) malloc(sizeof(uv_tcp_t));
ASSERT(handle != NULL);
uv_tcp_init((uv_tcp_t*)handle);
/* associate server with stream */
handle->data = server;
r = uv_accept(server, (uv_stream_t*)handle);
ASSERT(r == 0);
status = uv_getsockname((uv_tcp_t*)handle, &sockname, &namelen);
if (status != 0) {
fprintf(stderr, "uv_getsockname error (accepted) %d\n", uv_last_error().code);
}
ASSERT(status == 0);
getsocknamecount++;
r = uv_read_start((uv_stream_t*)handle, alloc, after_read);
ASSERT(r == 0);
}
static void on_connect(void* req) {
struct sockaddr sockname;
int namelen = sizeof(sockname);
int status;
status = uv_getsockname(&tcp, &sockname, &namelen);
if (status != 0) {
fprintf(stderr, "uv_getsockname error (connector) %d\n", uv_last_error().code);
}
ASSERT(status == 0);
getsocknamecount++;
uv_close((uv_handle_t*)&tcp, NULL);
}
static int tcp_listener(int port) {
struct sockaddr_in addr = uv_ip4_addr("0.0.0.0", port);
struct sockaddr sockname;
int namelen = sizeof(sockname);
int r;
r = uv_tcp_init(&tcpServer);
if (r) {
fprintf(stderr, "Socket creation error\n");
return 1;
}
r = uv_tcp_bind(&tcpServer, addr);
if (r) {
fprintf(stderr, "Bind error\n");
return 1;
}
r = uv_tcp_listen(&tcpServer, 128, on_connection);
if (r) {
fprintf(stderr, "Listen error\n");
return 1;
}
r = uv_getsockname(&tcpServer, &sockname, &namelen);
if (r != 0) {
fprintf(stderr, "uv_getsockname error (listening) %d\n", uv_last_error().code);
}
ASSERT(r == 0);
getsocknamecount++;
return 0;
}
static void tcp_connector() {
int r;
struct sockaddr_in server_addr = uv_ip4_addr("127.0.0.1", TEST_PORT);
r = uv_tcp_init(&tcp);
tcp.data = &connect_req;
ASSERT(!r);
uv_req_init(&connect_req, (uv_handle_t*)(&tcp), (void *(*)(void *))on_connect);
r = uv_tcp_connect(&connect_req, server_addr);
ASSERT(!r);
}
TEST_IMPL(getsockname) {
uv_init();
if (tcp_listener(TEST_PORT))
return 1;
tcp_connector();
uv_run();
ASSERT(getsocknamecount == 3);
return 0;
}

2
deps/uv/test/test-hrtime.c

@ -46,7 +46,7 @@ TEST_IMPL(hrtime) {
diff = b - a; diff = b - a;
printf("diff = %llu\n", diff); printf("diff = %llu\n", (unsigned long long int)diff);
ASSERT(diff >= NANOSEC / MICROSEC); ASSERT(diff >= NANOSEC / MICROSEC);
ASSERT(diff > MICROSEC); ASSERT(diff > MICROSEC);

31
deps/uv/test/test-list.h

@ -19,8 +19,9 @@
* IN THE SOFTWARE. * IN THE SOFTWARE.
*/ */
TEST_DECLARE (ping_pong) TEST_DECLARE (tcp_ping_pong)
TEST_DECLARE (ping_pong_v6) TEST_DECLARE (tcp_ping_pong_v6)
TEST_DECLARE (pipe_ping_pong)
TEST_DECLARE (delayed_accept) TEST_DECLARE (delayed_accept)
TEST_DECLARE (tcp_writealot) TEST_DECLARE (tcp_writealot)
TEST_DECLARE (bind_error_addrinuse) TEST_DECLARE (bind_error_addrinuse)
@ -52,22 +53,28 @@ TEST_DECLARE (hrtime)
TEST_DECLARE (getaddrinfo_basic) TEST_DECLARE (getaddrinfo_basic)
TEST_DECLARE (getaddrinfo_concurrent) TEST_DECLARE (getaddrinfo_concurrent)
TEST_DECLARE (gethostbyname) TEST_DECLARE (gethostbyname)
TEST_DECLARE (getsockname)
TEST_DECLARE (fail_always) TEST_DECLARE (fail_always)
TEST_DECLARE (pass_always) TEST_DECLARE (pass_always)
HELPER_DECLARE (echo_server) HELPER_DECLARE (tcp4_echo_server)
HELPER_DECLARE (tcp6_echo_server)
HELPER_DECLARE (pipe_echo_server)
TASK_LIST_START TASK_LIST_START
TEST_ENTRY (ping_pong) TEST_ENTRY (tcp_ping_pong)
TEST_HELPER (ping_pong, echo_server) TEST_HELPER (tcp_ping_pong, tcp4_echo_server)
TEST_ENTRY (ping_pong_v6) TEST_ENTRY (tcp_ping_pong_v6)
TEST_HELPER (ping_pong_v6, echo_server) TEST_HELPER (tcp_ping_pong_v6, tcp6_echo_server)
TEST_ENTRY (pipe_ping_pong)
TEST_HELPER (pipe_ping_pong, pipe_echo_server)
TEST_ENTRY (delayed_accept) TEST_ENTRY (delayed_accept)
TEST_ENTRY (tcp_writealot) TEST_ENTRY (tcp_writealot)
TEST_HELPER (tcp_writealot, echo_server) TEST_HELPER (tcp_writealot, tcp4_echo_server)
TEST_ENTRY (bind_error_addrinuse) TEST_ENTRY (bind_error_addrinuse)
TEST_ENTRY (bind_error_addrnotavail_1) TEST_ENTRY (bind_error_addrnotavail_1)
@ -86,10 +93,10 @@ TASK_LIST_START
TEST_ENTRY (connection_fail_doesnt_auto_close) TEST_ENTRY (connection_fail_doesnt_auto_close)
TEST_ENTRY (shutdown_eof) TEST_ENTRY (shutdown_eof)
TEST_HELPER (shutdown_eof, echo_server) TEST_HELPER (shutdown_eof, tcp4_echo_server)
TEST_ENTRY (callback_stack) TEST_ENTRY (callback_stack)
TEST_HELPER (callback_stack, echo_server) TEST_HELPER (callback_stack, tcp4_echo_server)
TEST_ENTRY (timer) TEST_ENTRY (timer)
@ -113,7 +120,9 @@ TASK_LIST_START
TEST_ENTRY (getaddrinfo_concurrent) TEST_ENTRY (getaddrinfo_concurrent)
TEST_ENTRY (gethostbyname) TEST_ENTRY (gethostbyname)
TEST_HELPER (gethostbyname, echo_server) TEST_HELPER (gethostbyname, tcp4_echo_server)
TEST_ENTRY (getsockname)
#if 0 #if 0
/* These are for testing the test runner. */ /* These are for testing the test runner. */

87
deps/uv/test/test-ping-pong.c

@ -39,7 +39,10 @@ static char PING[] = "PING\n";
typedef struct { typedef struct {
int pongs; int pongs;
int state; int state;
uv_tcp_t tcp; union {
uv_tcp_t tcp;
uv_pipe_t pipe;
};
uv_req_t connect_req; uv_req_t connect_req;
uv_req_t read_req; uv_req_t read_req;
char read_buffer[BUFSIZE]; char read_buffer[BUFSIZE];
@ -82,7 +85,8 @@ static void pinger_write_ping(pinger_t* pinger) {
buf.len = strlen(PING); buf.len = strlen(PING);
req = (uv_req_t*)malloc(sizeof(*req)); req = (uv_req_t*)malloc(sizeof(*req));
uv_req_init(req, (uv_handle_t*)(&pinger->tcp), pinger_after_write); uv_req_init(req, (uv_handle_t*)(&pinger->tcp),
(void *(*)(void *))pinger_after_write);
if (uv_write(req, &buf, 1)) { if (uv_write(req, &buf, 1)) {
FATAL("uv_write failed"); FATAL("uv_write failed");
@ -92,11 +96,11 @@ static void pinger_write_ping(pinger_t* pinger) {
} }
static void pinger_read_cb(uv_stream_t* tcp, ssize_t nread, uv_buf_t buf) { static void pinger_read_cb(uv_stream_t* stream, ssize_t nread, uv_buf_t buf) {
unsigned int i; unsigned int i;
pinger_t* pinger; pinger_t* pinger;
pinger = (pinger_t*)tcp->data; pinger = (pinger_t*)stream->data;
if (nread < 0) { if (nread < 0) {
ASSERT(uv_last_error().code == UV_EOF); ASSERT(uv_last_error().code == UV_EOF);
@ -141,9 +145,10 @@ static void pinger_on_connect(uv_req_t *req, int status) {
} }
static void pinger_new() { /* same ping-pong test, but using IPv6 connection */
static void tcp_pinger_v6_new() {
int r; int r;
struct sockaddr_in server_addr = uv_ip4_addr("127.0.0.1", TEST_PORT); struct sockaddr_in6 server_addr = uv_ip6_addr("::1", TEST_PORT);
pinger_t *pinger; pinger_t *pinger;
pinger = (pinger_t*)malloc(sizeof(*pinger)); pinger = (pinger_t*)malloc(sizeof(*pinger));
@ -158,29 +163,39 @@ static void pinger_new() {
/* We are never doing multiple reads/connects at a time anyway. */ /* We are never doing multiple reads/connects at a time anyway. */
/* so these handles can be pre-initialized. */ /* so these handles can be pre-initialized. */
uv_req_init(&pinger->connect_req, (uv_handle_t*)(&pinger->tcp), uv_req_init(&pinger->connect_req, (uv_handle_t*)(&pinger->tcp),
pinger_on_connect); (void *(*)(void *))pinger_on_connect);
r = uv_tcp_connect(&pinger->connect_req, server_addr); r = uv_tcp_connect6(&pinger->connect_req, server_addr);
ASSERT(!r); ASSERT(!r);
} }
TEST_IMPL(ping_pong) { static void tcp_pinger_new() {
uv_init(); int r;
struct sockaddr_in server_addr = uv_ip4_addr("127.0.0.1", TEST_PORT);
pinger_t *pinger;
pinger_new(); pinger = (pinger_t*)malloc(sizeof(*pinger));
uv_run(); pinger->state = 0;
pinger->pongs = 0;
ASSERT(completed_pingers == 1); /* Try to connec to the server and do NUM_PINGS ping-pongs. */
r = uv_tcp_init(&pinger->tcp);
pinger->tcp.data = pinger;
ASSERT(!r);
return 0; /* We are never doing multiple reads/connects at a time anyway. */
/* so these handles can be pre-initialized. */
uv_req_init(&pinger->connect_req, (uv_handle_t*)(&pinger->tcp),
(void *(*)(void *))pinger_on_connect);
r = uv_tcp_connect(&pinger->connect_req, server_addr);
ASSERT(!r);
} }
/* same ping-pong test, but using IPv6 connection */ static void pipe_pinger_new() {
static void pinger_v6_new() {
int r; int r;
struct sockaddr_in6 server_addr = uv_ip6_addr("::1", TEST_PORT);
pinger_t *pinger; pinger_t *pinger;
pinger = (pinger_t*)malloc(sizeof(*pinger)); pinger = (pinger_t*)malloc(sizeof(*pinger));
@ -188,24 +203,48 @@ static void pinger_v6_new() {
pinger->pongs = 0; pinger->pongs = 0;
/* Try to connec to the server and do NUM_PINGS ping-pongs. */ /* Try to connec to the server and do NUM_PINGS ping-pongs. */
r = uv_tcp_init(&pinger->tcp); r = uv_pipe_init(&pinger->pipe);
pinger->tcp.data = pinger; pinger->pipe.data = pinger;
ASSERT(!r); ASSERT(!r);
/* We are never doing multiple reads/connects at a time anyway. */ /* We are never doing multiple reads/connects at a time anyway. */
/* so these handles can be pre-initialized. */ /* so these handles can be pre-initialized. */
uv_req_init(&pinger->connect_req, (uv_handle_t*)(&pinger->tcp), uv_req_init(&pinger->connect_req, (uv_handle_t*)(&pinger->pipe),
pinger_on_connect); (void *(*)(void *))pinger_on_connect);
r = uv_tcp_connect6(&pinger->connect_req, server_addr); r = uv_pipe_connect(&pinger->connect_req, TEST_PIPENAME);
ASSERT(!r); ASSERT(!r);
} }
TEST_IMPL(ping_pong_v6) { TEST_IMPL(tcp_ping_pong) {
uv_init();
tcp_pinger_new();
uv_run();
ASSERT(completed_pingers == 1);
return 0;
}
TEST_IMPL(tcp_ping_pong_v6) {
uv_init();
tcp_pinger_v6_new();
uv_run();
ASSERT(completed_pingers == 1);
return 0;
}
TEST_IMPL(pipe_ping_pong) {
uv_init(); uv_init();
pinger_v6_new(); pipe_pinger_new();
uv_run(); uv_run();
ASSERT(completed_pingers == 1); ASSERT(completed_pingers == 1);

4
deps/uv/test/test-shutdown-eof.c

@ -102,7 +102,7 @@ static void connect_cb(uv_req_t *req, int status) {
uv_write(&write_req, &qbuf, 1); uv_write(&write_req, &qbuf, 1);
/* Shutdown our end of the connection. */ /* Shutdown our end of the connection. */
uv_req_init(&shutdown_req, (uv_handle_t*)&tcp, shutdown_cb); uv_req_init(&shutdown_req, (uv_handle_t*)&tcp, (void *(*)(void *))shutdown_cb);
uv_shutdown(&shutdown_req); uv_shutdown(&shutdown_req);
called_connect_cb++; called_connect_cb++;
@ -165,7 +165,7 @@ TEST_IMPL(shutdown_eof) {
r = uv_tcp_init(&tcp); r = uv_tcp_init(&tcp);
ASSERT(!r); ASSERT(!r);
uv_req_init(&connect_req, (uv_handle_t*) &tcp, connect_cb); uv_req_init(&connect_req, (uv_handle_t*) &tcp, (void *(*)(void *))connect_cb);
r = uv_tcp_connect(&connect_req, server_addr); r = uv_tcp_connect(&connect_req, server_addr);
ASSERT(!r); ASSERT(!r);

8
deps/uv/test/test-tcp-writealot.c

@ -144,7 +144,7 @@ static void connect_cb(uv_req_t* req, int status) {
req = (uv_req_t*)malloc(sizeof *req); req = (uv_req_t*)malloc(sizeof *req);
ASSERT(req != NULL); ASSERT(req != NULL);
uv_req_init(req, (uv_handle_t*)tcp, write_cb); uv_req_init(req, (uv_handle_t*)tcp, (void *(*)(void *))write_cb);
r = uv_write(req, (uv_buf_t*)&send_bufs, CHUNKS_PER_WRITE); r = uv_write(req, (uv_buf_t*)&send_bufs, CHUNKS_PER_WRITE);
ASSERT(r == 0); ASSERT(r == 0);
} }
@ -152,7 +152,7 @@ static void connect_cb(uv_req_t* req, int status) {
/* Shutdown on drain. FIXME: dealloc req? */ /* Shutdown on drain. FIXME: dealloc req? */
req = (uv_req_t*) malloc(sizeof(uv_req_t)); req = (uv_req_t*) malloc(sizeof(uv_req_t));
ASSERT(req != NULL); ASSERT(req != NULL);
uv_req_init(req, (uv_handle_t*)tcp, shutdown_cb); uv_req_init(req, (uv_handle_t*)tcp, (void *(*)(void *))shutdown_cb);
r = uv_shutdown(req); r = uv_shutdown(req);
ASSERT(r == 0); ASSERT(r == 0);
@ -160,7 +160,7 @@ static void connect_cb(uv_req_t* req, int status) {
req = (uv_req_t*)malloc(sizeof *req); req = (uv_req_t*)malloc(sizeof *req);
ASSERT(req != NULL); ASSERT(req != NULL);
uv_req_init(req, (uv_handle_t*)tcp, read_cb); uv_req_init(req, (uv_handle_t*)tcp, (void *(*)(void *))read_cb);
r = uv_read_start((uv_stream_t*)tcp, alloc_cb, read_cb); r = uv_read_start((uv_stream_t*)tcp, alloc_cb, read_cb);
ASSERT(r == 0); ASSERT(r == 0);
} }
@ -184,7 +184,7 @@ TEST_IMPL(tcp_writealot) {
r = uv_tcp_init(client); r = uv_tcp_init(client);
ASSERT(r == 0); ASSERT(r == 0);
uv_req_init(connect_req, (uv_handle_t*)client, connect_cb); uv_req_init(connect_req, (uv_handle_t*)client, (void *(*)(void *))connect_cb);
r = uv_tcp_connect(connect_req, addr); r = uv_tcp_connect(connect_req, addr);
ASSERT(r == 0); ASSERT(r == 0);

2
src/tcp_wrap.cc

@ -66,7 +66,7 @@ class ReqWrap {
ReqWrap(uv_handle_t* handle, void* callback) { ReqWrap(uv_handle_t* handle, void* callback) {
HandleScope scope; HandleScope scope;
object_ = Persistent<Object>::New(Object::New()); object_ = Persistent<Object>::New(Object::New());
uv_req_init(&req_, handle, callback); uv_req_init(&req_, handle, (void* (*)(void*))callback);
req_.data = this; req_.data = this;
} }

Loading…
Cancel
Save