Permalink
Browse files

uv: Upgrade to ad382bca

  • Loading branch information...
1 parent 85185bb commit e16d506a58d46619c05b08f3f8ef4d5491b18b69 @isaacs isaacs committed Jul 20, 2012
Showing with 1,970 additions and 2,144 deletions.
  1. +16 −0 deps/uv/AUTHORS
  2. +3 −1 deps/uv/Makefile
  3. +32 −1 deps/uv/include/ares.h
  4. +4 −4 deps/uv/include/ares_version.h
  5. +2 −14 deps/uv/include/uv-private/uv-unix.h
  6. +48 −23 deps/uv/include/uv.h
  7. +5 −1,216 deps/uv/src/ares/CHANGES
  8. +0 −22 deps/uv/src/ares/CMakeLists.txt
  9. +0 −21 deps/uv/src/ares/README.node
  10. +9 −19 deps/uv/src/ares/RELEASE-NOTES
  11. +4 −3 deps/uv/src/ares/ares__get_hostent.c
  12. +43 −2 deps/uv/src/ares/ares_data.c
  13. +9 −5 deps/uv/src/ares/ares_data.h
  14. +5 −3 deps/uv/src/ares/ares_destroy.c
  15. +20 −7 deps/uv/src/ares/ares_dns.h
  16. +6 −5 deps/uv/src/ares/ares_expand_name.c
  17. +3 −2 deps/uv/src/ares/ares_gethostbyname.c
  18. +2 −2 deps/uv/src/ares/ares_getnameinfo.c
  19. +549 −337 deps/uv/src/ares/ares_init.c
  20. +1 −1 deps/uv/src/ares/ares_library_init.h
  21. +81 −13 deps/uv/src/ares/ares_nowarn.c
  22. +8 −2 deps/uv/src/ares/ares_nowarn.h
  23. +3 −1 deps/uv/src/ares/ares_parse_aaaa_reply.c
  24. +188 −0 deps/uv/src/ares/ares_parse_naptr_reply.c
  25. +3 −2 deps/uv/src/ares/ares_parse_ptr_reply.c
  26. +135 −0 deps/uv/src/ares/ares_parse_soa_reply.c
  27. +1 −1 deps/uv/src/ares/ares_private.h
  28. +11 −12 deps/uv/src/ares/ares_process.c
  29. +1 −1 deps/uv/src/ares/ares_send.c
  30. +24 −2 deps/uv/src/ares/ares_setup.h
  31. +11 −10 deps/uv/src/ares/ares_timeout.c
  32. +25 −17 deps/uv/src/ares/setup_once.h
  33. +32 −1 deps/uv/src/unix/async.c
  34. +84 −51 deps/uv/src/unix/core.c
  35. +2 −1 deps/uv/src/unix/darwin.c
  36. +2 −16 deps/uv/src/unix/freebsd.c
  37. +2 −0 deps/uv/src/unix/internal.h
  38. +108 −0 deps/uv/src/unix/linux/syscalls.c
  39. +31 −0 deps/uv/src/unix/linux/syscalls.h
  40. +18 −17 deps/uv/src/unix/pipe.c
  41. +62 −0 deps/uv/src/unix/stream.c
  42. +10 −10 deps/uv/src/unix/sunos.c
  43. +61 −93 deps/uv/src/unix/tcp.c
  44. +0 −40 deps/uv/src/unix/thread.c
  45. +1 −1 deps/uv/test/benchmark-ares.c
  46. +97 −0 deps/uv/test/benchmark-async-pummel.c
  47. +137 −0 deps/uv/test/benchmark-async.c
  48. +0 −29 deps/uv/test/benchmark-fs-stat.c
  49. +17 −0 deps/uv/test/benchmark-list.h
  50. +5 −0 deps/uv/test/runner-unix.c
  51. +29 −0 deps/uv/test/runner.c
  52. +3 −0 deps/uv/test/task.h
  53. +1 −1 deps/uv/test/test-hrtime.c
  54. +0 −2 deps/uv/test/test-list.h
  55. +0 −5 deps/uv/test/test-poll-close.c
  56. +3 −10 deps/uv/test/test-process-title.c
  57. +8 −6 deps/uv/test/test-spawn.c
  58. +0 −111 deps/uv/test/test-tcp-unexpected-read.c
  59. +5 −1 deps/uv/uv.gyp
View
@@ -43,3 +43,19 @@ Paddy Byers <paddy.byers@gmail.com>
Dan VerWeire <dverweire@gmail.com>
Brandon Benvie <brandon@bbenvie.com>
Brandon Philips <brandon.philips@rackspace.com>
+Nathan Rajlich <nathan@tootallnate.net>
+Brandon Philips <brandon@ifup.org>
+Charlie McConnell <charlie@charlieistheman.com>
+Vladimir Dronnikov <dronnikov@gmail.com>
+Aaron Bieber <qbit@deftly.net>
+Bulat Shakirzyanov <mallluhuct@gmail.com>
+Brian White <mscdex@mscdex.net>
+Erik Dubbelboer <erik@dubbelboer.com>
+Keno Fischer <kenof@stanford.edu>
+Ira Cooper <Ira.Cooper@mathworks.com>
+Andrius Bentkus <andrius.bentkus@gmail.com>
+Brian White <mscdex@gmail.com>
+Iñaki Baz Castillo <ibc@aliax.net>
+Mark Cavage <mark.cavage@joyent.com>
+George Yohng <georgegh@oss3d.com>
+Xidorn Quan <quanxunzhen@gmail.com>
View
@@ -24,7 +24,7 @@ ifdef MSVC
uname_S := MINGW
endif
-CPPFLAGS += -Iinclude -Iinclude/uv-private
+CPPFLAGS += -Iinclude -Iinclude/uv-private -Isrc/ares
CARES_OBJS =
CARES_OBJS += src/ares/ares__close_sockets.o
@@ -53,8 +53,10 @@ CARES_OBJS += src/ares/ares_options.o
CARES_OBJS += src/ares/ares_parse_a_reply.o
CARES_OBJS += src/ares/ares_parse_aaaa_reply.o
CARES_OBJS += src/ares/ares_parse_mx_reply.o
+CARES_OBJS += src/ares/ares_parse_naptr_reply.o
CARES_OBJS += src/ares/ares_parse_ns_reply.o
CARES_OBJS += src/ares/ares_parse_ptr_reply.o
+CARES_OBJS += src/ares/ares_parse_soa_reply.o
CARES_OBJS += src/ares/ares_parse_srv_reply.o
CARES_OBJS += src/ares/ares_parse_txt_reply.o
CARES_OBJS += src/ares/ares_process.o
View
@@ -85,7 +85,8 @@ typedef int ares_socklen_t;
libc5-based Linux systems. Only include it on system that are known to
require it! */
#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
- defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY)
+ defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \
+ defined(ANDROID) || defined(__ANDROID__)
#include <sys/select.h>
#endif
#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
@@ -513,6 +514,26 @@ struct ares_txt_reply {
size_t length; /* length excludes null termination */
};
+struct ares_naptr_reply {
+ struct ares_naptr_reply *next;
+ unsigned char *flags;
+ unsigned char *service;
+ unsigned char *regexp;
+ char *replacement;
+ unsigned short order;
+ unsigned short preference;
+};
+
+struct ares_soa_reply {
+ char *nsname;
+ char *hostmaster;
+ unsigned int serial;
+ unsigned int refresh;
+ unsigned int retry;
+ unsigned int expire;
+ unsigned int minttl;
+};
+
/*
** Parse the buffer, starting at *abuf and of length alen bytes, previously
** obtained from an ares_search call. Put the results in *host, if nonnull.
@@ -556,10 +577,20 @@ CARES_EXTERN int ares_parse_txt_reply(const unsigned char* abuf,
int alen,
struct ares_txt_reply** txt_out);
+CARES_EXTERN int ares_parse_naptr_reply(const unsigned char* abuf,
+ int alen,
+ struct ares_naptr_reply** naptr_out);
+
+CARES_EXTERN int ares_parse_soa_reply(const unsigned char* abuf,
+ int alen,
+ struct ares_soa_reply** soa_out);
+
CARES_EXTERN void ares_free_string(void *str);
CARES_EXTERN void ares_free_hostent(struct hostent *host);
+CARES_EXTERN void ares_free_soa(struct ares_soa_reply *soa);
+
CARES_EXTERN void ares_free_data(void *dataptr);
CARES_EXTERN const char *ares_strerror(int code);
@@ -3,15 +3,15 @@
#define ARES__VERSION_H
/* This is the global package copyright */
-#define ARES_COPYRIGHT "2004 - 2010 Daniel Stenberg, <daniel@haxx.se>."
+#define ARES_COPYRIGHT "2004 - 2012 Daniel Stenberg, <daniel@haxx.se>."
#define ARES_VERSION_MAJOR 1
-#define ARES_VERSION_MINOR 7
-#define ARES_VERSION_PATCH 5
+#define ARES_VERSION_MINOR 9
+#define ARES_VERSION_PATCH 0
#define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
(ARES_VERSION_MINOR<<8)|\
(ARES_VERSION_PATCH))
-#define ARES_VERSION_STR "1.7.5-DEV"
+#define ARES_VERSION_STR "1.9.0-DEV"
#if (ARES_VERSION >= 0x010700)
# define CARES_HAVE_ARES_LIBRARY_INIT 1
@@ -40,17 +40,10 @@
#include <termios.h>
#include <pwd.h>
+#include <semaphore.h>
#include <pthread.h>
#include <signal.h>
-#if defined(__APPLE__) && defined(__MACH__)
-# include <mach/mach.h>
-# include <mach/task.h>
-# include <mach/semaphore.h>
-#else
-# include <semaphore.h>
-#endif
-
#if __sun
# include <sys/port.h>
# include <port.h>
@@ -74,11 +67,7 @@ typedef pthread_once_t uv_once_t;
typedef pthread_t uv_thread_t;
typedef pthread_mutex_t uv_mutex_t;
typedef pthread_rwlock_t uv_rwlock_t;
-#if defined(__APPLE__) && defined(__MACH__)
-typedef semaphore_t uv_sem_t;
-#else
typedef sem_t uv_sem_t;
-#endif
/* Platform-specific definitions for uv_spawn support. */
typedef gid_t uv_gid_t;
@@ -113,7 +102,7 @@ struct uv__io_s {
int inotify_fd;
#elif defined(PORT_SOURCE_FILE)
# define UV_LOOP_PRIVATE_PLATFORM_FIELDS \
- ev_io fs_event_watcher; \
+ uv__io_t fs_event_watcher; \
int fs_fd;
#else
# define UV_LOOP_PRIVATE_PLATFORM_FIELDS
@@ -303,7 +292,6 @@ struct uv__io_s {
#ifdef PORT_SOURCE_FILE
# define UV_FS_EVENT_PRIVATE_FIELDS \
- ev_io event_watcher; \
uv_fs_event_cb cb; \
file_obj_t fo; \
int fd;
View
@@ -49,7 +49,7 @@ extern "C" {
#define UV_VERSION_MAJOR 0
-#define UV_VERSION_MINOR 8
+#define UV_VERSION_MINOR 9
#include <stdint.h> /* int64_t */
@@ -181,7 +181,7 @@ typedef enum {
} uv_req_type;
-
+/* Handle types. */
typedef struct uv_loop_s uv_loop_t;
typedef struct uv_ares_task_s uv_ares_task_t;
typedef struct uv_err_s uv_err_t;
@@ -197,23 +197,25 @@ typedef struct uv_prepare_s uv_prepare_t;
typedef struct uv_check_s uv_check_t;
typedef struct uv_idle_s uv_idle_t;
typedef struct uv_async_s uv_async_t;
-typedef struct uv_getaddrinfo_s uv_getaddrinfo_t;
typedef struct uv_process_s uv_process_t;
-typedef struct uv_counters_s uv_counters_t;
-typedef struct uv_cpu_info_s uv_cpu_info_t;
-typedef struct uv_interface_address_s uv_interface_address_t;
-/* Request types */
+typedef struct uv_fs_event_s uv_fs_event_t;
+typedef struct uv_fs_poll_s uv_fs_poll_t;
+
+/* Request types. */
typedef struct uv_req_s uv_req_t;
+typedef struct uv_getaddrinfo_s uv_getaddrinfo_t;
typedef struct uv_shutdown_s uv_shutdown_t;
typedef struct uv_write_s uv_write_t;
typedef struct uv_connect_s uv_connect_t;
typedef struct uv_udp_send_s uv_udp_send_t;
typedef struct uv_fs_s uv_fs_t;
-/* uv_fs_event_t is a subclass of uv_handle_t. */
-typedef struct uv_fs_event_s uv_fs_event_t;
-typedef struct uv_fs_poll_s uv_fs_poll_t;
typedef struct uv_work_s uv_work_t;
+/* None of the above. */
+typedef struct uv_counters_s uv_counters_t;
+typedef struct uv_cpu_info_s uv_cpu_info_t;
+typedef struct uv_interface_address_s uv_interface_address_t;
+
/*
* This function must be called before any other functions in libuv.
@@ -298,13 +300,14 @@ typedef void (*uv_async_cb)(uv_async_t* handle, int status);
typedef void (*uv_prepare_cb)(uv_prepare_t* handle, int status);
typedef void (*uv_check_cb)(uv_check_t* handle, int status);
typedef void (*uv_idle_cb)(uv_idle_t* handle, int status);
-typedef void (*uv_getaddrinfo_cb)(uv_getaddrinfo_t* handle, int status,
- struct addrinfo* res);
typedef void (*uv_exit_cb)(uv_process_t*, int exit_status, int term_signal);
+typedef void (*uv_walk_cb)(uv_handle_t* handle, void* arg);
typedef void (*uv_fs_cb)(uv_fs_t* req);
typedef void (*uv_work_cb)(uv_work_t* req);
typedef void (*uv_after_work_cb)(uv_work_t* req);
-typedef void (*uv_walk_cb)(uv_handle_t* handle, void* arg);
+typedef void (*uv_getaddrinfo_cb)(uv_getaddrinfo_t* req,
+ int status,
+ struct addrinfo* res);
/*
* This will be called repeatedly after the uv_fs_event_t is initialized.
@@ -1156,19 +1159,33 @@ struct uv_getaddrinfo_s {
/*
* Asynchronous getaddrinfo(3).
*
- * Return code 0 means that request is accepted and callback will be called
- * with result. Other return codes mean that there will not be a callback.
- * Input arguments may be released after return from this call.
+ * Either node or service may be NULL but not both.
+ *
+ * hints is a pointer to a struct addrinfo with additional address type
+ * constraints, or NULL. Consult `man -s 3 getaddrinfo` for details.
*
- * uv_freeaddrinfo() must be called after completion to free the addrinfo
- * structure.
+ * Returns 0 on success, -1 on error. Call uv_last_error() to get the error.
*
- * On error NXDOMAIN the status code will be non-zero and UV_ENOENT returned.
+ * If successful, your callback gets called sometime in the future with the
+ * lookup result, which is either:
+ *
+ * a) status == 0, the res argument points to a valid struct addrinfo, or
+ * b) status == -1, the res argument is NULL.
+ *
+ * On NXDOMAIN, the status code is -1 and uv_last_error() returns UV_ENOENT.
+ *
+ * Call uv_freeaddrinfo() to free the addrinfo structure.
*/
-UV_EXTERN int uv_getaddrinfo(uv_loop_t*, uv_getaddrinfo_t* handle,
- uv_getaddrinfo_cb getaddrinfo_cb, const char* node, const char* service,
- const struct addrinfo* hints);
+UV_EXTERN int uv_getaddrinfo(uv_loop_t* loop,
+ uv_getaddrinfo_t* req,
+ uv_getaddrinfo_cb getaddrinfo_cb,
+ const char* node,
+ const char* service,
+ const struct addrinfo* hints);
+/*
+ * Free the struct addrinfo. Passing NULL is allowed and is a no-op.
+ */
UV_EXTERN void uv_freeaddrinfo(struct addrinfo* ai);
/* uv_spawn() options */
@@ -1709,15 +1726,21 @@ UV_EXTERN int uv_thread_join(uv_thread_t *tid);
/* the presence of these unions force similar struct layout */
union uv_any_handle {
+ uv_handle_t handle;
+ uv_stream_t stream;
uv_tcp_t tcp;
uv_pipe_t pipe;
uv_prepare_t prepare;
uv_check_t check;
uv_idle_t idle;
uv_async_t async;
uv_timer_t timer;
- uv_getaddrinfo_t getaddrinfo;
uv_fs_event_t fs_event;
+ uv_fs_poll_t fs_poll;
+ uv_poll_t poll;
+ uv_process_t process;
+ uv_tty_t tty;
+ uv_udp_t udp;
};
union uv_any_req {
@@ -1727,6 +1750,8 @@ union uv_any_req {
uv_shutdown_t shutdown;
uv_fs_t fs_req;
uv_work_t work_req;
+ uv_udp_send_t udp_send_req;
+ uv_getaddrinfo_t getaddrinfo_req;
};
Oops, something went wrong.

0 comments on commit e16d506

Please sign in to comment.