Skip to content

Commit

Permalink
Make gethostbyaddr fail with ECANCELLED for ares_cancel()
Browse files Browse the repository at this point in the history
When `ares_cancel()` was invoked, `ares_gethostbyaddr()`
queries would fail with `ENOTFOUND` instead of `ECANCELLED`.

It seems appropriate to treat `ares_cancel()` like `ares_destroy()`,
but I would appreciate review of the correctness of this change.

Ref: nodejs/node#14814
  • Loading branch information
addaleax committed Aug 14, 2017
1 parent 33bf5ba commit 0283e9b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ares_gethostbyaddr.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static void addr_callback(void *arg, int status, int timeouts,
}
end_aquery(aquery, status, host);
}
else if (status == ARES_EDESTRUCTION)
else if (status == ARES_EDESTRUCTION || status == ARES_ECANCELLED)
end_aquery(aquery, status, NULL);
else
next_lookup(aquery);
Expand Down

0 comments on commit 0283e9b

Please sign in to comment.