Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
win: rename uv_loop_t.ares_channel to ares_chan to avoid confusing g++
Browse files Browse the repository at this point in the history
  • Loading branch information
piscisaureus committed Sep 4, 2011
1 parent 360f411 commit 7b87ff7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion include/uv-private/uv-win.h
Expand Up @@ -73,7 +73,7 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
uv_prepare_t* next_prepare_handle; \
uv_check_t* next_check_handle; \
uv_idle_t* next_idle_handle; \
ares_channel ares_channel; \
ares_channel ares_chan; \
int ares_active_sockets; \
uv_timer_t ares_polling_timer; \
/* Last error code */ \
Expand Down
14 changes: 7 additions & 7 deletions src/win/cares.c
Expand Up @@ -95,8 +95,8 @@ static void CALLBACK uv_ares_socksignal_tp(void* parameter,
/* periodically call ares to check for timeouts */
static void uv_ares_poll(uv_timer_t* handle, int status) {
uv_loop_t* loop = handle->loop;
if (loop->ares_channel != NULL && loop->ares_active_sockets > 0) {
ares_process_fd(loop->ares_channel, ARES_SOCKET_BAD, ARES_SOCKET_BAD);
if (loop->ares_chan != NULL && loop->ares_active_sockets > 0) {
ares_process_fd(loop->ares_chan, ARES_SOCKET_BAD, ARES_SOCKET_BAD);
}
}

Expand Down Expand Up @@ -214,7 +214,7 @@ static void uv_ares_sockstate_cb(void *data, ares_socket_t sock, int read,
/* called via uv_poll when ares completion port signaled */
void uv_process_ares_event_req(uv_loop_t* loop, uv_ares_action_t* handle,
uv_req_t* req) {
ares_process_fd(loop->ares_channel,
ares_process_fd(loop->ares_chan,
handle->read ? handle->sock : INVALID_SOCKET,
handle->write ? handle->sock : INVALID_SOCKET);

Expand Down Expand Up @@ -258,7 +258,7 @@ int uv_ares_init_options(uv_loop_t* loop,
int rc;

/* only allow single init at a time */
if (loop->ares_channel != NULL) {
if (loop->ares_chan != NULL) {
return UV_EALREADY;
}

Expand All @@ -272,7 +272,7 @@ int uv_ares_init_options(uv_loop_t* loop,

/* if success, save channel */
if (rc == ARES_SUCCESS) {
loop->ares_channel = *channelptr;
loop->ares_chan = *channelptr;
}

return rc;
Expand All @@ -282,8 +282,8 @@ int uv_ares_init_options(uv_loop_t* loop,
/* release memory */
void uv_ares_destroy(uv_loop_t* loop, ares_channel channel) {
/* only allow destroy if did init */
if (loop->ares_channel != NULL) {
if (loop->ares_chan != NULL) {
ares_destroy(channel);
loop->ares_channel = NULL;
loop->ares_chan = NULL;
}
}
2 changes: 1 addition & 1 deletion src/win/core.c
Expand Up @@ -62,7 +62,7 @@ static void uv_loop_init(uv_loop_t* loop) {
loop->next_idle_handle = NULL;

loop->ares_active_sockets = 0;
loop->ares_channel = NULL;
loop->ares_chan = NULL;

loop->last_error = uv_ok_;
}
Expand Down

0 comments on commit 7b87ff7

Please sign in to comment.