mirror of
https://github.com/nodejs/node-v0.x-archive.git
synced 2026-04-28 03:01:10 -04:00
Upgrade libuv to 5b567b2
This commit is contained in:
2
deps/uv/AUTHORS
vendored
2
deps/uv/AUTHORS
vendored
@@ -19,3 +19,5 @@ Andrea Lattuada <ndr.lattuada@gmail.com>
|
||||
Augusto Henrique Hentz <ahhentz@gmail.com>
|
||||
Clifford Heath <clifford.heath@gmail.com>
|
||||
Jorge Chamorro Bieling <jorge@jorgechamorro.com>
|
||||
Luis Lavena <luislavena@gmail.com>
|
||||
Matthew Sporleder <msporleder@gmail.com>
|
||||
|
||||
8
deps/uv/config-unix.mk
vendored
8
deps/uv/config-unix.mk
vendored
@@ -72,6 +72,14 @@ LINKFLAGS+=
|
||||
OBJS += src/unix/freebsd.o
|
||||
endif
|
||||
|
||||
ifeq (NetBSD,$(uname_S))
|
||||
EV_CONFIG=config_netbsd.h
|
||||
EIO_CONFIG=config_netbsd.h
|
||||
CPPFLAGS += -Isrc/ares/config_netbsd
|
||||
LINKFLAGS+=
|
||||
OBJS += src/unix/netbsd.o
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring CYGWIN,$(uname_S)))
|
||||
EV_CONFIG=config_cygwin.h
|
||||
EIO_CONFIG=config_cygwin.h
|
||||
|
||||
510
deps/uv/src/ares/config_netbsd/ares_config.h
vendored
Normal file
510
deps/uv/src/ares/config_netbsd/ares_config.h
vendored
Normal file
@@ -0,0 +1,510 @@
|
||||
/* ares_config.h. Generated from ares_config.h.in by configure. */
|
||||
/* ares_config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* 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 */
|
||||
/* #undef CARES_BUILDING_LIBRARY */
|
||||
|
||||
/* when not building a shared library */
|
||||
/* #undef CARES_STATICLIB */
|
||||
|
||||
/* Define to 1 to enable hiding of library internal symbols. */
|
||||
/* #undef CARES_SYMBOL_HIDING */
|
||||
|
||||
/* Definition to make a library symbol externally visible. */
|
||||
/* #undef CARES_SYMBOL_SCOPE_EXTERN */
|
||||
|
||||
/* if a /etc/inet dir is being used */
|
||||
/* #undef ETC_INET */
|
||||
|
||||
/* Define to the type qualifier of arg 1 for getnameinfo. */
|
||||
#define GETNAMEINFO_QUAL_ARG1 const
|
||||
|
||||
/* Define to the type of arg 1 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG1 struct sockaddr *
|
||||
|
||||
/* Define to the type of arg 2 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG2 socklen_t
|
||||
|
||||
/* Define to the type of args 4 and 6 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG46 size_t
|
||||
|
||||
/* Define to the type of arg 7 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG7 int
|
||||
|
||||
/* Specifies the number of arguments to getservbyport_r */
|
||||
#define GETSERVBYPORT_R_ARGS 4
|
||||
|
||||
/* Specifies the size of the buffer to pass to getservbyport_r */
|
||||
#define GETSERVBYPORT_R_BUFSIZE sizeof(struct servent_data)
|
||||
|
||||
/* Define to 1 if you have AF_INET6. */
|
||||
#define HAVE_AF_INET6 1
|
||||
|
||||
/* Define to 1 if you have the <arpa/inet.h> header file. */
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
|
||||
/* Define to 1 if you have the <arpa/nameser_compat.h> header file. */
|
||||
/* #undef HAVE_ARPA_NAMESER_COMPAT_H */
|
||||
|
||||
/* Define to 1 if you have the <arpa/nameser.h> header file. */
|
||||
#define HAVE_ARPA_NAMESER_H 1
|
||||
|
||||
/* Define to 1 if you have the <assert.h> header file. */
|
||||
#define HAVE_ASSERT_H 1
|
||||
|
||||
/* Define to 1 if you have the `bitncmp' function. */
|
||||
/* #undef HAVE_BITNCMP */
|
||||
|
||||
/* Define to 1 if bool is an available type. */
|
||||
#define HAVE_BOOL_T 1
|
||||
|
||||
/* Define to 1 if you have the clock_gettime function and monotonic timer. */
|
||||
#define HAVE_CLOCK_GETTIME_MONOTONIC 1
|
||||
|
||||
/* Define to 1 if you have the closesocket function. */
|
||||
/* #undef HAVE_CLOSESOCKET */
|
||||
|
||||
/* Define to 1 if you have the CloseSocket camel case 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. */
|
||||
#define HAVE_DLFCN_H 1
|
||||
|
||||
/* 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. */
|
||||
#define HAVE_FCNTL 1
|
||||
|
||||
/* 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. */
|
||||
#define HAVE_FCNTL_O_NONBLOCK 1
|
||||
|
||||
/* Define to 1 if you have the freeaddrinfo function. */
|
||||
#define HAVE_FREEADDRINFO 1
|
||||
|
||||
/* Define to 1 if you have a working getaddrinfo function. */
|
||||
#define HAVE_GETADDRINFO 1
|
||||
|
||||
/* 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 to 1 if you have the getnameinfo function. */
|
||||
#define HAVE_GETNAMEINFO 1
|
||||
|
||||
/* Define to 1 if you have the getservbyport_r function. */
|
||||
#define HAVE_GETSERVBYPORT_R 1
|
||||
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
|
||||
/* Define to 1 if you have the `if_indextoname' function. */
|
||||
#define HAVE_IF_INDEXTONAME 1
|
||||
|
||||
/* Define to 1 if you have the `inet_net_pton' function. */
|
||||
#define HAVE_INET_NET_PTON 1
|
||||
|
||||
/* 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. */
|
||||
#define HAVE_INET_NTOP 1
|
||||
|
||||
/* Define to 1 if you have a IPv6 capable working inet_pton function. */
|
||||
#define HAVE_INET_PTON 1
|
||||
|
||||
/* 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. */
|
||||
#define HAVE_IOCTL 1
|
||||
|
||||
/* Define to 1 if you have the ioctlsocket function. */
|
||||
/* #undef HAVE_IOCTLSOCKET */
|
||||
|
||||
/* Define to 1 if you have the IoctlSocket camel case 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. */
|
||||
/* #undef HAVE_IOCTLSOCKET_FIONBIO */
|
||||
|
||||
/* Define to 1 if you have a working ioctl FIONBIO function. */
|
||||
#define HAVE_IOCTL_FIONBIO 1
|
||||
|
||||
/* Define to 1 if you have a working ioctl SIOCGIFADDR function. */
|
||||
#define HAVE_IOCTL_SIOCGIFADDR 1
|
||||
|
||||
/* 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. */
|
||||
#define HAVE_NETDB_H 1
|
||||
|
||||
/* Define to 1 if you have the <netinet/in.h> header file. */
|
||||
#define HAVE_NETINET_IN_H 1
|
||||
|
||||
/* Define to 1 if you have the <netinet/tcp.h> header file. */
|
||||
#define HAVE_NETINET_TCP_H 1
|
||||
|
||||
/* Define to 1 if you have the <net/if.h> header file. */
|
||||
#define HAVE_NET_IF_H 1
|
||||
|
||||
/* 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 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. */
|
||||
/* #undef HAVE_STRCMPI */
|
||||
|
||||
/* Define to 1 if you have the strdup function. */
|
||||
#define HAVE_STRDUP 1
|
||||
|
||||
/* Define to 1 if you have the stricmp function. */
|
||||
/* #undef HAVE_STRICMP */
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 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. */
|
||||
#define HAVE_SYS_IOCTL_H 1
|
||||
|
||||
/* 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. */
|
||||
#define HAVE_SYS_SELECT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
||||
#define HAVE_SYS_SOCKET_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H 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. */
|
||||
#define HAVE_SYS_UIO_H 1
|
||||
|
||||
/* 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. */
|
||||
/* #undef HAVE_WINDOWS_H */
|
||||
|
||||
/* Define to 1 if you have the winsock2.h header file. */
|
||||
/* #undef HAVE_WINSOCK2_H */
|
||||
|
||||
/* Define to 1 if you have the winsock.h header file. */
|
||||
/* #undef HAVE_WINSOCK_H */
|
||||
|
||||
/* Define to 1 if you have the writev function. */
|
||||
#define HAVE_WRITEV 1
|
||||
|
||||
/* Define to 1 if you have the ws2tcpip.h header file. */
|
||||
/* #undef HAVE_WS2TCPIP_H */
|
||||
|
||||
/* 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. */
|
||||
/* #undef NATIVE_WINDOWS */
|
||||
|
||||
/* 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 "i386-unknown-openbsd4.7"
|
||||
|
||||
/* 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 PACKAGE_NAME "c-ares"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "c-ares 1.7.1"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "c-ares"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#define PACKAGE_URL ""
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "1.7.1"
|
||||
|
||||
/* a suitable file/device to read random data from */
|
||||
#define RANDOM_FILE "/dev/urandom"
|
||||
|
||||
/* Define to the type of arg 1 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type pointed by arg 2 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG2 void
|
||||
|
||||
/* Define to 1 if the type pointed by arg 2 for recvfrom is void. */
|
||||
#define RECVFROM_TYPE_ARG2_IS_VOID 1
|
||||
|
||||
/* Define to the type of arg 3 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG3 size_t
|
||||
|
||||
/* 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 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 RECVFROM_TYPE_ARG6 socklen_t
|
||||
|
||||
/* 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 RECVFROM_TYPE_RETV int
|
||||
|
||||
/* Define to the type of arg 1 for recv. */
|
||||
#define RECV_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type of arg 2 for recv. */
|
||||
#define RECV_TYPE_ARG2 void *
|
||||
|
||||
/* Define to the type of arg 3 for recv. */
|
||||
#define RECV_TYPE_ARG3 size_t
|
||||
|
||||
/* 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 RETSIGTYPE void
|
||||
|
||||
/* Define to the type qualifier of arg 2 for send. */
|
||||
#define SEND_QUAL_ARG2 const
|
||||
|
||||
/* Define to the type of arg 1 for send. */
|
||||
#define SEND_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type of arg 2 for send. */
|
||||
#define SEND_TYPE_ARG2 void *
|
||||
|
||||
/* Define to the type of arg 3 for send. */
|
||||
#define SEND_TYPE_ARG3 size_t
|
||||
|
||||
/* 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
|
||||
|
||||
/* The size of `int', as computed by sizeof. */
|
||||
#define SIZEOF_INT 4
|
||||
|
||||
/* The size of `long', as computed by sizeof. */
|
||||
#define SIZEOF_LONG 4
|
||||
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#define SIZEOF_SIZE_T 4
|
||||
|
||||
/* The size of `struct in6_addr', as computed by sizeof. */
|
||||
#define SIZEOF_STRUCT_IN6_ADDR 16
|
||||
|
||||
/* The size of `struct in_addr', as computed by sizeof. */
|
||||
#define SIZEOF_STRUCT_IN_ADDR 4
|
||||
|
||||
/* The size of `time_t', as computed by sizeof. */
|
||||
#define SIZEOF_TIME_T 4
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#define TIME_WITH_SYS_TIME 1
|
||||
|
||||
/* Define to disable non-blocking sockets. */
|
||||
/* #undef USE_BLOCKING_SOCKETS */
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "1.7.1"
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
#if defined AC_APPLE_UNIVERSAL_BUILD
|
||||
# if defined __BIG_ENDIAN__
|
||||
# define WORDS_BIGENDIAN 1
|
||||
# endif
|
||||
#else
|
||||
# ifndef WORDS_BIGENDIAN
|
||||
/* # undef WORDS_BIGENDIAN */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Define to 1 if OS is AIX. */
|
||||
#ifndef _ALL_SOURCE
|
||||
/* # undef _ALL_SOURCE */
|
||||
#endif
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
/* #undef _FILE_OFFSET_BITS */
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
/* #undef _LARGE_FILES */
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
/* #undef const */
|
||||
|
||||
/* Type to use in place of in_addr_t when system does not provide it. */
|
||||
/* #undef in_addr_t */
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
/* #undef size_t */
|
||||
|
||||
/* the signed version of size_t */
|
||||
/* #undef ssize_t */
|
||||
2
deps/uv/src/unix/core.c
vendored
2
deps/uv/src/unix/core.c
vendored
@@ -235,6 +235,8 @@ void uv__finish_close(uv_handle_t* handle) {
|
||||
case UV_TCP:
|
||||
assert(!ev_is_active(&((uv_stream_t*)handle)->read_watcher));
|
||||
assert(!ev_is_active(&((uv_stream_t*)handle)->write_watcher));
|
||||
assert(((uv_stream_t*)handle)->fd == -1);
|
||||
uv__stream_destroy((uv_stream_t*)handle);
|
||||
break;
|
||||
|
||||
case UV_UDP:
|
||||
|
||||
81
deps/uv/src/unix/eio/config_netbsd.h
vendored
Normal file
81
deps/uv/src/unix/eio/config_netbsd.h
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
/* config.h. Generated from config.h.in by configure. */
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#define HAVE_DLFCN_H 1
|
||||
|
||||
/* fdatasync(2) is available */
|
||||
/* #undef HAVE_FDATASYNC */
|
||||
|
||||
/* utimes(2) is available */
|
||||
#define HAVE_UTIMES 1
|
||||
|
||||
/* futimes(2) is available */
|
||||
#define HAVE_FUTIMES 1
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* pread(2) and pwrite(2) are available */
|
||||
#define HAVE_PREADWRITE 1
|
||||
|
||||
/* readahead(2) is available (linux) */
|
||||
/* #undef HAVE_READAHEAD */
|
||||
|
||||
/* sendfile(2) is available and supported */
|
||||
#define HAVE_SENDFILE 0
|
||||
|
||||
/* 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 <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* sync_file_range(2) is available */
|
||||
/* #undef HAVE_SYNC_FILE_RANGE */
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_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 <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||
*/
|
||||
#define LT_OBJDIR ".libs/"
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "libeio"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT ""
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME ""
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING ""
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME ""
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION ""
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "1.0"
|
||||
120
deps/uv/src/unix/ev/config_netbsd.h
vendored
Normal file
120
deps/uv/src/unix/ev/config_netbsd.h
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
/* config.h. Generated from config.h.in by configure. */
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define to 1 if you have the `clock_gettime' function. */
|
||||
/* #undef HAVE_CLOCK_GETTIME */
|
||||
|
||||
/* "use syscall interface for clock_gettime" */
|
||||
/* #undef HAVE_CLOCK_SYSCALL */
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#define HAVE_DLFCN_H 1
|
||||
|
||||
/* Define to 1 if you have the `epoll_ctl' function. */
|
||||
/* #undef HAVE_EPOLL_CTL */
|
||||
|
||||
/* Define to 1 if you have the `eventfd' function. */
|
||||
/* #undef HAVE_EVENTFD */
|
||||
|
||||
/* Define to 1 if you have the `inotify_init' function. */
|
||||
/* #undef HAVE_INOTIFY_INIT */
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the `kqueue' function. */
|
||||
#define HAVE_KQUEUE 1
|
||||
|
||||
/* Define to 1 if you have the `m' library (-lm). */
|
||||
#define HAVE_LIBM 1
|
||||
|
||||
/* Define to 1 if you have the `rt' library (-lrt). */
|
||||
/* #undef HAVE_LIBRT */
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define to 1 if you have the `nanosleep' function. */
|
||||
/* #undef HAVE_NANOSLEEP */
|
||||
|
||||
/* Define to 1 if you have the `poll' function. */
|
||||
#define HAVE_POLL 1
|
||||
|
||||
/* Define to 1 if you have the <poll.h> header file. */
|
||||
#define HAVE_POLL_H 1
|
||||
|
||||
/* Define to 1 if you have the `port_create' function. */
|
||||
/* #undef HAVE_PORT_CREATE */
|
||||
|
||||
/* Define to 1 if you have the <port.h> header file. */
|
||||
/* #undef HAVE_PORT_H */
|
||||
|
||||
/* Define to 1 if you have the `select' function. */
|
||||
#define HAVE_SELECT 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 <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/epoll.h> header file. */
|
||||
/* #undef HAVE_SYS_EPOLL_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/eventfd.h> header file. */
|
||||
/* #undef HAVE_SYS_EVENTFD_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/event.h> header file. */
|
||||
#define HAVE_SYS_EVENT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/inotify.h> header file. */
|
||||
/* #undef HAVE_SYS_INOTIFY_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/queue.h> header file. */
|
||||
#define HAVE_SYS_QUEUE_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/select.h> header file. */
|
||||
#define HAVE_SYS_SELECT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_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 <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||
*/
|
||||
#define LT_OBJDIR ".libs/"
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "libev"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT ""
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME ""
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING ""
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME ""
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION ""
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "3.9"
|
||||
1
deps/uv/src/unix/internal.h
vendored
1
deps/uv/src/unix/internal.h
vendored
@@ -81,6 +81,7 @@ void uv_fatal_error(const int errorno, const char* syscall);
|
||||
|
||||
/* stream */
|
||||
int uv__stream_open(uv_stream_t*, int fd, int flags);
|
||||
void uv__stream_destroy(uv_stream_t* stream);
|
||||
void uv__stream_io(EV_P_ ev_io* watcher, int revents);
|
||||
void uv__server_io(EV_P_ ev_io* watcher, int revents);
|
||||
int uv__accept(int sockfd, struct sockaddr* saddr, socklen_t len);
|
||||
|
||||
68
deps/uv/src/unix/netbsd.c
vendored
Normal file
68
deps/uv/src/unix/netbsd.c
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
/* 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 <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
#include <unistd.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) {
|
||||
uint32_t usize;
|
||||
int result;
|
||||
char* path;
|
||||
char* fullpath;
|
||||
int mib[4];
|
||||
size_t cb;
|
||||
pid_t mypid;
|
||||
|
||||
if (!buffer || !size) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
mypid = getpid();
|
||||
mib[0] = CTL_KERN;
|
||||
mib[1] = KERN_PROC_ARGS;
|
||||
mib[2] = mypid;
|
||||
mib[3] = KERN_PROC_ARGV;
|
||||
|
||||
cb = *size;
|
||||
if (sysctl(mib, 4, buffer, &cb, NULL, 0) < 0) {
|
||||
*size = 0;
|
||||
return -1;
|
||||
}
|
||||
*size = strlen(buffer);
|
||||
|
||||
return 0;
|
||||
}
|
||||
29
deps/uv/src/unix/stream.c
vendored
29
deps/uv/src/unix/stream.c
vendored
@@ -75,6 +75,35 @@ int uv__stream_open(uv_stream_t* stream, int fd, int flags) {
|
||||
}
|
||||
|
||||
|
||||
/* Clears out the write queue, invokes the callbacks attached
|
||||
* to each write request. Used when a stream is destroyed.
|
||||
*/
|
||||
static void uv__clear_queue(ngx_queue_t* wq, int status, uv_err_code code) {
|
||||
uv_write_t* req;
|
||||
ngx_queue_t* q;
|
||||
|
||||
while (!ngx_queue_empty(wq)) {
|
||||
q = ngx_queue_head(wq);
|
||||
ngx_queue_remove(q);
|
||||
|
||||
req = ngx_queue_data(q, uv_write_t, queue);
|
||||
if (req->cb) {
|
||||
uv_err_new(req->handle->loop, code);
|
||||
req->cb(req, status);
|
||||
}
|
||||
|
||||
if (req->bufs != req->bufsml)
|
||||
free(req->bufs);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void uv__stream_destroy(uv_stream_t* stream) {
|
||||
uv__clear_queue(&stream->write_queue, -1, UV_EINTR);
|
||||
uv__clear_queue(&stream->write_completed_queue, 0, UV_OK);
|
||||
}
|
||||
|
||||
|
||||
void uv__server_io(EV_P_ ev_io* watcher, int revents) {
|
||||
int fd;
|
||||
struct sockaddr_storage addr;
|
||||
|
||||
2
deps/uv/src/win/fs.c
vendored
2
deps/uv/src/win/fs.c
vendored
@@ -575,7 +575,7 @@ void fs__symlink(uv_fs_t* req, const char* path, const char* new_path,
|
||||
}
|
||||
} else {
|
||||
result = -1;
|
||||
errno = ENOTSUP;
|
||||
errno = ENOSYS;
|
||||
}
|
||||
|
||||
SET_REQ_RESULT(req, result);
|
||||
|
||||
2
deps/uv/src/win/getaddrinfo.c
vendored
2
deps/uv/src/win/getaddrinfo.c
vendored
@@ -29,7 +29,7 @@
|
||||
/*
|
||||
* MinGW is missing this
|
||||
*/
|
||||
#ifndef _MSC_VER
|
||||
#if !defined(_MSC_VER) && !defined(__MINGW64_VERSION_MAJOR)
|
||||
typedef struct addrinfoW {
|
||||
int ai_flags;
|
||||
int ai_family;
|
||||
|
||||
2
deps/uv/src/win/process.c
vendored
2
deps/uv/src/win/process.c
vendored
@@ -1007,7 +1007,7 @@ done:
|
||||
/* it's way with them. But at least make them noninheritable. */
|
||||
int i;
|
||||
for (i = 0; i < COUNTOF(process->child_stdio); i++) {
|
||||
SetHandleInformation(child_stdio[1], HANDLE_FLAG_INHERIT, 0);
|
||||
SetHandleInformation(child_stdio[i], HANDLE_FLAG_INHERIT, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
2147
deps/uv/src/win/winapi.h
vendored
2147
deps/uv/src/win/winapi.h
vendored
File diff suppressed because it is too large
Load Diff
2
deps/uv/test/run-tests.c
vendored
2
deps/uv/test/run-tests.c
vendored
@@ -28,12 +28,10 @@
|
||||
/* Actual tests and helpers are defined in test-list.h */
|
||||
#include "test-list.h"
|
||||
|
||||
|
||||
/* The time in milliseconds after which a single test times out. */
|
||||
#define TEST_TIMEOUT 5000
|
||||
|
||||
static int maybe_run_test(int argc, char **argv);
|
||||
static void list_all_tests(void);
|
||||
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
9
deps/uv/test/test-fs.c
vendored
9
deps/uv/test/test-fs.c
vendored
@@ -31,7 +31,9 @@
|
||||
#include <sys/stat.h>
|
||||
|
||||
|
||||
#if !UNIX
|
||||
#if UNIX
|
||||
#include <unistd.h> /* unlink, rmdir, etc. */
|
||||
#else
|
||||
# include <direct.h>
|
||||
# include <io.h>
|
||||
# define unlink _unlink
|
||||
@@ -421,6 +423,11 @@ static void check_utime(const char* path, double atime, double mtime) {
|
||||
#if _WIN32
|
||||
ASSERT(s->st_atime == atime);
|
||||
ASSERT(s->st_mtime == mtime);
|
||||
#elif !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
|
||||
ASSERT(s->st_atimespec.tv_sec == atime);
|
||||
ASSERT(s->st_atimespec.tv_nsec == 0); /* FIXME check sub-second precision */
|
||||
ASSERT(s->st_mtimespec.tv_sec == mtime);
|
||||
ASSERT(s->st_mtimespec.tv_nsec == 0); /* FIXME check sub-second precision */
|
||||
#else
|
||||
ASSERT(s->st_atim.tv_sec == atime);
|
||||
ASSERT(s->st_atim.tv_nsec == 0); /* FIXME check sub-second precision */
|
||||
|
||||
14
deps/uv/test/test-get-currentexe.c
vendored
14
deps/uv/test/test-get-currentexe.c
vendored
@@ -30,15 +30,25 @@ TEST_IMPL(get_currentexe) {
|
||||
char buffer[PATHMAX];
|
||||
size_t size;
|
||||
char* match;
|
||||
char* path;
|
||||
int r;
|
||||
|
||||
size = sizeof(buffer) / sizeof(buffer[0]);
|
||||
r = uv_exepath(buffer, &size);
|
||||
ASSERT(!r);
|
||||
|
||||
match = strstr(buffer, executable_path);
|
||||
/* uv_exepath can return an absolute path on darwin, so if the test runner
|
||||
* was run with a relative prefix of "./", we need to strip that prefix off
|
||||
* executable_path or we'll fail. */
|
||||
if (executable_path[0] == '.' && executable_path[1] == '/') {
|
||||
path = executable_path + 2;
|
||||
} else {
|
||||
path = executable_path;
|
||||
}
|
||||
|
||||
match = strstr(buffer, path);
|
||||
/* Verify that the path returned from uv_exepath is a subdirectory of executable_path */
|
||||
ASSERT(match && !strcmp(match, executable_path));
|
||||
ASSERT(match && !strcmp(match, path));
|
||||
ASSERT(size == strlen(buffer));
|
||||
|
||||
/* Negative tests */
|
||||
|
||||
2
deps/uv/test/test-list.h
vendored
2
deps/uv/test/test-list.h
vendored
@@ -31,6 +31,7 @@ TEST_DECLARE (tcp_bind_error_fault)
|
||||
TEST_DECLARE (tcp_bind_error_inval)
|
||||
TEST_DECLARE (tcp_bind_localhost_ok)
|
||||
TEST_DECLARE (tcp_listen_without_bind)
|
||||
TEST_DECLARE (tcp_close)
|
||||
TEST_DECLARE (tcp_bind6_error_addrinuse)
|
||||
TEST_DECLARE (tcp_bind6_error_addrnotavail)
|
||||
TEST_DECLARE (tcp_bind6_error_fault)
|
||||
@@ -117,6 +118,7 @@ TASK_LIST_START
|
||||
TEST_ENTRY (tcp_bind_error_inval)
|
||||
TEST_ENTRY (tcp_bind_localhost_ok)
|
||||
TEST_ENTRY (tcp_listen_without_bind)
|
||||
TEST_ENTRY (tcp_close)
|
||||
|
||||
TEST_ENTRY (tcp_bind6_error_addrinuse)
|
||||
TEST_ENTRY (tcp_bind6_error_addrnotavail)
|
||||
|
||||
3
deps/uv/test/test-spawn.c
vendored
3
deps/uv/test/test-spawn.c
vendored
@@ -23,12 +23,13 @@
|
||||
#include "task.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
static int close_cb_called;
|
||||
static int exit_cb_called;
|
||||
static uv_process_t process;
|
||||
static uv_timer_t timer;
|
||||
static uv_process_options_t options = { 0 };
|
||||
static uv_process_options_t options;
|
||||
static char exepath[1024];
|
||||
static size_t exepath_size = 1024;
|
||||
static char* args[3];
|
||||
|
||||
130
deps/uv/test/test-tcp-close.c
vendored
Normal file
130
deps/uv/test/test-tcp-close.c
vendored
Normal file
@@ -0,0 +1,130 @@
|
||||
/* 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 <errno.h>
|
||||
#include <string.h> /* memset */
|
||||
|
||||
#define NUM_WRITE_REQS 32
|
||||
|
||||
static uv_tcp_t tcp_handle;
|
||||
static uv_connect_t connect_req;
|
||||
|
||||
static int write_cb_called;
|
||||
static int close_cb_called;
|
||||
|
||||
static void connect_cb(uv_connect_t* req, int status);
|
||||
static void write_cb(uv_write_t* req, int status);
|
||||
static void close_cb(uv_handle_t* handle);
|
||||
|
||||
|
||||
static void connect_cb(uv_connect_t* conn_req, int status) {
|
||||
uv_write_t* req;
|
||||
uv_buf_t buf;
|
||||
int i, r;
|
||||
|
||||
buf = uv_buf_init("PING", 4);
|
||||
for (i = 0; i < NUM_WRITE_REQS; i++) {
|
||||
req = malloc(sizeof *req);
|
||||
ASSERT(req != NULL);
|
||||
|
||||
r = uv_write(req, (uv_stream_t*)&tcp_handle, &buf, 1, write_cb);
|
||||
ASSERT(r == 0);
|
||||
}
|
||||
|
||||
uv_close((uv_handle_t*)&tcp_handle, close_cb);
|
||||
}
|
||||
|
||||
|
||||
static void write_cb(uv_write_t* req, int status) {
|
||||
/* write callbacks should run before the close callback */
|
||||
ASSERT(close_cb_called == 0);
|
||||
ASSERT(req->handle == (uv_stream_t*)&tcp_handle);
|
||||
write_cb_called++;
|
||||
free(req);
|
||||
}
|
||||
|
||||
|
||||
static void close_cb(uv_handle_t* handle) {
|
||||
ASSERT(handle == (uv_handle_t*)&tcp_handle);
|
||||
close_cb_called++;
|
||||
}
|
||||
|
||||
|
||||
static void connection_cb(uv_stream_t* server, int status) {
|
||||
ASSERT(status == 0);
|
||||
}
|
||||
|
||||
|
||||
static void start_server(uv_loop_t* loop, uv_tcp_t* handle) {
|
||||
int r;
|
||||
|
||||
r = uv_tcp_init(loop, handle);
|
||||
ASSERT(r == 0);
|
||||
|
||||
r = uv_tcp_bind(handle, uv_ip4_addr("127.0.0.1", TEST_PORT));
|
||||
ASSERT(r == 0);
|
||||
|
||||
r = uv_listen((uv_stream_t*)handle, 128, connection_cb);
|
||||
ASSERT(r == 0);
|
||||
|
||||
uv_unref(loop);
|
||||
}
|
||||
|
||||
|
||||
/* Check that pending write requests have their callbacks
|
||||
* invoked when the handle is closed.
|
||||
*/
|
||||
TEST_IMPL(tcp_close) {
|
||||
uv_loop_t* loop;
|
||||
uv_tcp_t tcp_server;
|
||||
int r;
|
||||
|
||||
uv_init();
|
||||
loop = uv_default_loop();
|
||||
|
||||
/* We can't use the echo server, it doesn't handle ECONNRESET. */
|
||||
start_server(loop, &tcp_server);
|
||||
|
||||
r = uv_tcp_init(loop, &tcp_handle);
|
||||
ASSERT(r == 0);
|
||||
|
||||
r = uv_tcp_connect(&connect_req,
|
||||
&tcp_handle,
|
||||
uv_ip4_addr("127.0.0.1", TEST_PORT),
|
||||
connect_cb);
|
||||
ASSERT(r == 0);
|
||||
|
||||
ASSERT(write_cb_called == 0);
|
||||
ASSERT(close_cb_called == 0);
|
||||
|
||||
r = uv_run(loop);
|
||||
ASSERT(r == 0);
|
||||
|
||||
printf("%d of %d write reqs seen\n", write_cb_called, NUM_WRITE_REQS);
|
||||
|
||||
ASSERT(write_cb_called == NUM_WRITE_REQS);
|
||||
ASSERT(close_cb_called == 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
3
deps/uv/uv.gyp
vendored
3
deps/uv/uv.gyp
vendored
@@ -88,7 +88,6 @@
|
||||
'include_dirs': [
|
||||
'src/ares/config_win32'
|
||||
],
|
||||
'sources': [ 'src/ares/windows_port.c' ],
|
||||
'defines': [
|
||||
'_WIN32_WINNT=0x0502',
|
||||
'EIO_STACKSIZE=262144',
|
||||
@@ -98,6 +97,7 @@
|
||||
'include/uv-private/tree.h',
|
||||
'include/uv-private/uv-win.h',
|
||||
'src/ares/config_win32/ares_config.h',
|
||||
'src/ares/windows_port.c',
|
||||
'src/win/async.c',
|
||||
'src/win/cares.c',
|
||||
'src/win/core.c',
|
||||
@@ -245,6 +245,7 @@
|
||||
'test/test-spawn.c',
|
||||
'test/test-tcp-bind-error.c',
|
||||
'test/test-tcp-bind6-error.c',
|
||||
'test/test-tcp-close.c',
|
||||
'test/test-tcp-writealot.c',
|
||||
'test/test-threadpool.c',
|
||||
'test/test-timer-again.c',
|
||||
|
||||
Reference in New Issue
Block a user