Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
update uv to 2df831723fad25d2d97b824b2e52c65082af2723
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Zinkovsky committed May 22, 2012
1 parent 6e435da commit dff467d
Show file tree
Hide file tree
Showing 18 changed files with 50 additions and 609 deletions.
12 changes: 6 additions & 6 deletions deps/uv/config-mingw.mk
Expand Up @@ -37,14 +37,14 @@ RUNNER_LINKFLAGS=$(LINKFLAGS)
RUNNER_LIBS=-lws2_32 -lpsapi -liphlpapi
RUNNER_SRC=test/runner-win.c

uv.a: $(WIN_OBJS) src/uv-common.o $(CARES_OBJS)
$(AR) rcs uv.a src/win/*.o src/uv-common.o $(CARES_OBJS)
uv.a: $(WIN_OBJS) src/cares.o src/uv-common.o $(CARES_OBJS)
$(AR) rcs uv.a $(WIN_OBJS) src/cares.o src/uv-common.o $(CARES_OBJS)

src/win/%.o: src/win/%.c src/win/internal.h
$(CC) $(CFLAGS) -o $@ -c $<
src/%.o: src/%.c include/uv.h include/uv-private/uv-win.h
$(CC) $(CFLAGS) -c $< -o $@

src/uv-common.o: src/uv-common.c include/uv.h include/uv-private/uv-win.h
$(CC) $(CFLAGS) -c src/uv-common.c -o src/uv-common.o
src/win/%.o: src/win/%.c include/uv.h include/uv-private/uv-win.h src/win/internal.h
$(CC) $(CFLAGS) -o $@ -c $<

EIO_CPPFLAGS += $(CPPFLAGS)
EIO_CPPFLAGS += -DEIO_STACKSIZE=65536
Expand Down
15 changes: 7 additions & 8 deletions deps/uv/config-unix.mk
Expand Up @@ -21,14 +21,13 @@
E=
CSTDFLAG=--std=c89 -pedantic -Wall -Wextra -Wno-unused-parameter
CFLAGS += -g
CPPFLAGS += -Isrc/unix/ev
CPPFLAGS += -Isrc -Isrc/unix/ev
LINKFLAGS=-lm

CPPFLAGS += -D_LARGEFILE_SOURCE
CPPFLAGS += -D_FILE_OFFSET_BITS=64

OBJS += src/unix/async.o
OBJS += src/unix/cares.o
OBJS += src/unix/core.o
OBJS += src/unix/dl.o
OBJS += src/unix/error.o
Expand Down Expand Up @@ -129,14 +128,14 @@ endif
RUNNER_LIBS=
RUNNER_SRC=test/runner-unix.c

uv.a: $(OBJS) src/uv-common.o src/unix/ev/ev.o src/unix/uv-eio.o src/unix/eio/eio.o $(CARES_OBJS)
$(AR) rcs uv.a $(OBJS) src/uv-common.o src/unix/uv-eio.o src/unix/ev/ev.o src/unix/eio/eio.o $(CARES_OBJS)
uv.a: $(OBJS) src/cares.o src/uv-common.o src/unix/ev/ev.o src/unix/uv-eio.o src/unix/eio/eio.o $(CARES_OBJS)
$(AR) rcs uv.a $(OBJS) src/cares.o src/uv-common.o src/unix/uv-eio.o src/unix/ev/ev.o src/unix/eio/eio.o $(CARES_OBJS)

src/unix/%.o: src/unix/%.c include/uv.h include/uv-private/uv-unix.h src/unix/internal.h
$(CC) $(CSTDFLAG) $(CPPFLAGS) -Isrc $(CFLAGS) -c $< -o $@
src/%.o: src/%.c include/uv.h include/uv-private/uv-unix.h
$(CC) $(CSTDFLAG) $(CPPFLAGS) $(CFLAGS) -c $< -o $@

src/uv-common.o: src/uv-common.c include/uv.h include/uv-private/uv-unix.h
$(CC) $(CSTDFLAG) $(CPPFLAGS) $(CFLAGS) -c src/uv-common.c -o src/uv-common.o
src/unix/%.o: src/unix/%.c include/uv.h include/uv-private/uv-unix.h src/unix/internal.h
$(CC) $(CSTDFLAG) $(CPPFLAGS) $(CFLAGS) -c $< -o $@

src/unix/ev/ev.o: src/unix/ev/ev.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c src/unix/ev/ev.c -o src/unix/ev/ev.o -DEV_CONFIG_H=\"$(EV_CONFIG)\"
Expand Down
8 changes: 0 additions & 8 deletions deps/uv/include/uv-private/uv-unix.h
Expand Up @@ -70,7 +70,6 @@ typedef struct {
char* errmsg;
} uv_lib_t;

#define UV_HANDLE_TYPE_PRIVATE /* empty */
#define UV_REQ_TYPE_PRIVATE /* empty */

#if __linux__
Expand All @@ -90,13 +89,6 @@ typedef struct {
#endif

#define UV_LOOP_PRIVATE_FIELDS \
ares_channel channel; \
/* \
* While the channel is active this timer is called once per second to be \
* sure that we're always calling ares_process. See the warning above the \
* definition of ares_timeout(). \
*/ \
uv_timer_t timer; \
/* Poll result queue */ \
eio_channel uv_eio_channel; \
struct ev_loop* ev; \
Expand Down
9 changes: 0 additions & 9 deletions deps/uv/include/uv-private/uv-win.h
Expand Up @@ -231,23 +231,14 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
uv_idle_t* next_idle_handle; \
/* This handle holds the peer sockets for the fast variant of uv_poll_t */ \
SOCKET poll_peer_sockets[UV_MSAFD_PROVIDER_COUNT]; \
/* State used by uv_ares. */ \
ares_channel ares_chan; \
int ares_active_sockets; \
uv_timer_t ares_polling_timer; \
/* Counter to keep track of active tcp streams */ \
unsigned int active_tcp_streams; \
/* Counter to keep track of active udp streams */ \
unsigned int active_udp_streams;

#define UV_HANDLE_TYPE_PRIVATE \
UV_ARES_EVENT,

#define UV_REQ_TYPE_PRIVATE \
/* TODO: remove the req suffix */ \
UV_ACCEPT, \
UV_ARES_EVENT_REQ, \
UV_ARES_CLEANUP_REQ, \
UV_FS_EVENT_REQ, \
UV_POLL_REQ, \
UV_PROCESS_EXIT, \
Expand Down
10 changes: 7 additions & 3 deletions deps/uv/include/uv.h
Expand Up @@ -137,7 +137,6 @@ typedef enum {
#undef UV_ERRNO_GEN

#define UV_HANDLE_TYPE_MAP(XX) \
XX(ARES_TASK, ares_task) \
XX(ASYNC, async) \
XX(CHECK, check) \
XX(FS_EVENT, fs_event) \
Expand Down Expand Up @@ -165,8 +164,8 @@ typedef enum {
#define XX(uc, lc) UV_##uc,
UV_HANDLE_TYPE_MAP(XX)
#undef XX
UV_ARES_TASK,
UV_FILE,
UV_HANDLE_TYPE_PRIVATE
UV_HANDLE_TYPE_MAX
} uv_handle_type;

Expand Down Expand Up @@ -1645,8 +1644,13 @@ struct uv_counters_s {

struct uv_loop_s {
UV_LOOP_PRIVATE_FIELDS
ares_channel channel;
/* While the channel is active this timer is called once per second to be */
/* sure that we're always calling ares_process. See the warning above the */
/* definition of ares_timeout(). */
uv_timer_t ares_timer; \
/* RB_HEAD(uv__ares_tasks, uv_ares_task_t) */
struct uv__ares_tasks { uv_ares_task_t* rbh_root; } uv_ares_handles_;
struct uv__ares_tasks { uv_ares_task_t* rbh_root; } ares_handles;
/* Diagnostic counters */
uv_counters_t counters;
/* The last error */
Expand Down
179 changes: 0 additions & 179 deletions deps/uv/src/unix/cares.c

This file was deleted.

4 changes: 0 additions & 4 deletions deps/uv/src/unix/internal.h
Expand Up @@ -27,7 +27,6 @@

#include <assert.h>
#include <stdlib.h> /* abort */
#include <stddef.h> /* offsetof */

#if __STRICT_ANSI__
# define inline __inline
Expand Down Expand Up @@ -64,9 +63,6 @@
# define HAVE_KQUEUE 1
#endif

#define container_of(ptr, type, member) \
((type *) ((char *) (ptr) - offsetof(type, member)))

#define UNREACHABLE() \
do { \
assert(0 && "unreachable code"); \
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/src/unix/loop.c
Expand Up @@ -41,7 +41,7 @@ int uv__loop_init(uv_loop_t* loop, int default_loop) {
ngx_queue_init(&loop->active_reqs);
#endif

RB_INIT(&loop->uv_ares_handles_);
RB_INIT(&loop->ares_handles);
ngx_queue_init(&loop->idle_handles);
ngx_queue_init(&loop->check_handles);
ngx_queue_init(&loop->prepare_handles);
Expand Down
37 changes: 0 additions & 37 deletions deps/uv/src/uv-common.c
Expand Up @@ -199,43 +199,6 @@ int uv_ip6_name(struct sockaddr_in6* src, char* dst, size_t size) {
}


static int cmp_ares_tasks(const uv_ares_task_t* a, const uv_ares_task_t* b) {
if (a->sock < b->sock) return -1;
if (a->sock > b->sock) return 1;
return 0;
}


RB_GENERATE_STATIC(uv__ares_tasks, uv_ares_task_s, node, cmp_ares_tasks)


/* add ares handle to list */
void uv_add_ares_handle(uv_loop_t* loop, uv_ares_task_t* handle) {
assert(loop == handle->loop);
RB_INSERT(uv__ares_tasks, &loop->uv_ares_handles_, handle);
}


/* find matching ares handle in list */
uv_ares_task_t* uv_find_ares_handle(uv_loop_t* loop, ares_socket_t sock) {
uv_ares_task_t handle;
handle.sock = sock;
return RB_FIND(uv__ares_tasks, &loop->uv_ares_handles_, &handle);
}


/* remove ares handle in list */
void uv_remove_ares_handle(uv_ares_task_t* handle) {
RB_REMOVE(uv__ares_tasks, &handle->loop->uv_ares_handles_, handle);
}


/* Returns 1 if the uv_ares_handles_ list is empty. 0 otherwise. */
int uv_ares_handles_empty(uv_loop_t* loop) {
return RB_EMPTY(&loop->uv_ares_handles_);
}


int uv_tcp_bind(uv_tcp_t* handle, struct sockaddr_in addr) {
if (handle->type != UV_TCP || addr.sin_family != AF_INET) {
uv__set_artificial_error(handle->loop, UV_EFAULT);
Expand Down

2 comments on commit dff467d

@piscisaureus
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@igorzi You forgot to add the new file src/cares.c.

@igorzi
Copy link

@igorzi igorzi commented on dff467d May 23, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for noticing that. looks like @bnoordhuis upgraded libuv again

Please sign in to comment.