@@ -123,7 +123,7 @@ static void NewQueryReqWrap(const FunctionCallbackInfo<Value>& args) {
123
123
}
124
124
125
125
126
- static int cmp_ares_tasks (const ares_task_t * a, const ares_task_t * b) {
126
+ static int cmp_ares_tasks (const node_ares_task * a, const node_ares_task * b) {
127
127
if (a->sock < b->sock )
128
128
return -1 ;
129
129
if (a->sock > b->sock )
@@ -132,7 +132,7 @@ static int cmp_ares_tasks(const ares_task_t* a, const ares_task_t* b) {
132
132
}
133
133
134
134
135
- RB_GENERATE_STATIC (ares_task_list, ares_task_t , node, cmp_ares_tasks)
135
+ RB_GENERATE_STATIC (node_ares_task_list, node_ares_task , node, cmp_ares_tasks)
136
136
137
137
138
138
@@ -146,7 +146,7 @@ static void ares_timeout(uv_timer_t* handle) {
146
146
147
147
148
148
static void ares_poll_cb (uv_poll_t * watcher, int status, int events) {
149
- ares_task_t * task = ContainerOf (&ares_task_t ::poll_watcher, watcher);
149
+ node_ares_task * task = ContainerOf (&node_ares_task ::poll_watcher, watcher);
150
150
Environment* env = task->env ;
151
151
152
152
/* Reset the idle timer */
@@ -167,15 +167,15 @@ static void ares_poll_cb(uv_poll_t* watcher, int status, int events) {
167
167
168
168
169
169
static void ares_poll_close_cb (uv_handle_t * watcher) {
170
- ares_task_t * task = ContainerOf (&ares_task_t ::poll_watcher,
170
+ node_ares_task * task = ContainerOf (&node_ares_task ::poll_watcher,
171
171
reinterpret_cast <uv_poll_t *>(watcher));
172
172
free (task);
173
173
}
174
174
175
175
176
- /* Allocates and returns a new ares_task_t */
177
- static ares_task_t * ares_task_create (Environment* env, ares_socket_t sock) {
178
- ares_task_t * task = static_cast <ares_task_t *>(malloc (sizeof (*task)));
176
+ /* Allocates and returns a new node_ares_task */
177
+ static node_ares_task * ares_task_create (Environment* env, ares_socket_t sock) {
178
+ node_ares_task * task = static_cast <node_ares_task *>(malloc (sizeof (*task)));
179
179
180
180
if (task == nullptr ) {
181
181
/* Out of memory. */
@@ -201,11 +201,11 @@ static void ares_sockstate_cb(void* data,
201
201
int read,
202
202
int write) {
203
203
Environment* env = static_cast <Environment*>(data);
204
- ares_task_t * task;
204
+ node_ares_task * task;
205
205
206
- ares_task_t lookup_task;
206
+ node_ares_task lookup_task;
207
207
lookup_task.sock = sock;
208
- task = RB_FIND (ares_task_list , env->cares_task_list (), &lookup_task);
208
+ task = RB_FIND (node_ares_task_list , env->cares_task_list (), &lookup_task);
209
209
210
210
if (read || write ) {
211
211
if (!task) {
@@ -226,7 +226,7 @@ static void ares_sockstate_cb(void* data,
226
226
return ;
227
227
}
228
228
229
- RB_INSERT (ares_task_list , env->cares_task_list (), task);
229
+ RB_INSERT (node_ares_task_list , env->cares_task_list (), task);
230
230
}
231
231
232
232
/* This should never fail. If it fails anyway, the query will eventually */
@@ -242,7 +242,7 @@ static void ares_sockstate_cb(void* data,
242
242
CHECK (task &&
243
243
" When an ares socket is closed we should have a handle for it" );
244
244
245
- RB_REMOVE (ares_task_list , env->cares_task_list (), task);
245
+ RB_REMOVE (node_ares_task_list , env->cares_task_list (), task);
246
246
uv_close (reinterpret_cast <uv_handle_t *>(&task->poll_watcher ),
247
247
ares_poll_close_cb);
248
248
0 commit comments