Skip to content

Commit

Permalink
deps: cherry-pick 0ef4a0c64b6 from c-ares upstream
Browse files Browse the repository at this point in the history
Original commit message:

  gethostbyaddr: fail with `ECANCELLED` for `ares_cancel()`

  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#14814

Fixes: nodejs#14814

PR-URL: nodejs#15023
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
addaleax authored and BridgeAR committed Oct 2, 2017
1 parent 9a0631d commit 50e580d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deps/cares/src/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 50e580d

Please sign in to comment.