@@ -91,7 +91,7 @@ static void NewQueryReqWrap(const FunctionCallbackInfo<Value>& args) { |
91 | 91 | } |
92 | 92 |
|
93 | 93 |
|
94 | | -static int cmp_ares_tasks(const ares_task_t* a, const ares_task_t* b) { |
| 94 | +static int cmp_ares_tasks(const node_ares_task* a, const node_ares_task* b) { |
95 | 95 | if (a->sock < b->sock) |
96 | 96 | return -1; |
97 | 97 | if (a->sock > b->sock) |
@@ -100,7 +100,7 @@ static int cmp_ares_tasks(const ares_task_t* a, const ares_task_t* b) { |
100 | 100 | } |
101 | 101 |
|
102 | 102 |
|
103 | | -RB_GENERATE_STATIC(ares_task_list, ares_task_t, node, cmp_ares_tasks) |
| 103 | +RB_GENERATE_STATIC(node_ares_task_list, node_ares_task, node, cmp_ares_tasks) |
104 | 104 |
|
105 | 105 |
|
106 | 106 |
|
@@ -114,7 +114,7 @@ static void ares_timeout(uv_timer_t* handle) { |
114 | 114 |
|
115 | 115 |
|
116 | 116 | static void ares_poll_cb(uv_poll_t* watcher, int status, int events) { |
117 | | - ares_task_t* task = ContainerOf(&ares_task_t::poll_watcher, watcher); |
| 117 | + node_ares_task* task = ContainerOf(&node_ares_task::poll_watcher, watcher); |
118 | 118 | Environment* env = task->env; |
119 | 119 |
|
120 | 120 | /* Reset the idle timer */ |
@@ -135,15 +135,15 @@ static void ares_poll_cb(uv_poll_t* watcher, int status, int events) { |
135 | 135 |
|
136 | 136 |
|
137 | 137 | static void ares_poll_close_cb(uv_handle_t* watcher) { |
138 | | - ares_task_t* task = ContainerOf(&ares_task_t::poll_watcher, |
| 138 | + node_ares_task* task = ContainerOf(&node_ares_task::poll_watcher, |
139 | 139 | reinterpret_cast<uv_poll_t*>(watcher)); |
140 | 140 | free(task); |
141 | 141 | } |
142 | 142 |
|
143 | 143 |
|
144 | | -/* Allocates and returns a new ares_task_t */ |
145 | | -static ares_task_t* ares_task_create(Environment* env, ares_socket_t sock) { |
146 | | - ares_task_t* task = static_cast<ares_task_t*>(malloc(sizeof(*task))); |
| 144 | +/* Allocates and returns a new node_ares_task */ |
| 145 | +static node_ares_task* ares_task_create(Environment* env, ares_socket_t sock) { |
| 146 | + node_ares_task* task = static_cast<node_ares_task*>(malloc(sizeof(*task))); |
147 | 147 |
|
148 | 148 | if (task == nullptr) { |
149 | 149 | /* Out of memory. */ |
@@ -169,11 +169,11 @@ static void ares_sockstate_cb(void* data, |
169 | 169 | int read, |
170 | 170 | int write) { |
171 | 171 | Environment* env = static_cast<Environment*>(data); |
172 | | - ares_task_t* task; |
| 172 | + node_ares_task* task; |
173 | 173 |
|
174 | | - ares_task_t lookup_task; |
| 174 | + node_ares_task lookup_task; |
175 | 175 | lookup_task.sock = sock; |
176 | | - task = RB_FIND(ares_task_list, env->cares_task_list(), &lookup_task); |
| 176 | + task = RB_FIND(node_ares_task_list, env->cares_task_list(), &lookup_task); |
177 | 177 |
|
178 | 178 | if (read || write) { |
179 | 179 | if (!task) { |
@@ -194,7 +194,7 @@ static void ares_sockstate_cb(void* data, |
194 | 194 | return; |
195 | 195 | } |
196 | 196 |
|
197 | | - RB_INSERT(ares_task_list, env->cares_task_list(), task); |
| 197 | + RB_INSERT(node_ares_task_list, env->cares_task_list(), task); |
198 | 198 | } |
199 | 199 |
|
200 | 200 | /* This should never fail. If it fails anyway, the query will eventually */ |
@@ -210,7 +210,7 @@ static void ares_sockstate_cb(void* data, |
210 | 210 | CHECK(task && |
211 | 211 | "When an ares socket is closed we should have a handle for it"); |
212 | 212 |
|
213 | | - RB_REMOVE(ares_task_list, env->cares_task_list(), task); |
| 213 | + RB_REMOVE(node_ares_task_list, env->cares_task_list(), task); |
214 | 214 | uv_close(reinterpret_cast<uv_handle_t*>(&task->poll_watcher), |
215 | 215 | ares_poll_close_cb); |
216 | 216 |
|
|