src: migrate deprecated c-ares APIs to modern replacements#62724
Open
om-ghante wants to merge 1 commit intonodejs:mainfrom
Open
src: migrate deprecated c-ares APIs to modern replacements#62724om-ghante wants to merge 1 commit intonodejs:mainfrom
om-ghante wants to merge 1 commit intonodejs:mainfrom
Conversation
Collaborator
|
Review requested:
|
d0750bf to
140cde3
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #62724 +/- ##
==========================================
- Coverage 91.55% 89.64% -1.92%
==========================================
Files 355 706 +351
Lines 149381 218240 +68859
Branches 23364 41769 +18405
==========================================
+ Hits 136765 195638 +58873
- Misses 12354 14505 +2151
- Partials 262 8097 +7835
🚀 New features to boost your workflow:
|
140cde3 to
abc640a
Compare
Member
|
CI is very red |
abc640a to
fedc05d
Compare
Contributor
Author
|
Thanks @mcollina! Fixed — the CI failures were all caused by unrelated formatting changes in test/parallel/test-dns.js that got pulled in from the eslint v10 bump. I've force-pushed a clean version that only touches src/cares_wrap.cc (the c-ares migration) and a minimal 1-hunk change in test-dns.js (DNS server seeding for sandboxed CI environments). CI should be green now. |
a2e786d to
60968d8
Compare
Replace all deprecated c-ares function calls in cares_wrap.cc with their modern equivalents, resolving 26 compiler deprecation warnings. DNS record parsing (ares_dns_parse + record iteration): - ares_parse_a_reply -> ares_dns_parse + ARES_RR_A_ADDR - ares_parse_aaaa_reply -> ares_dns_parse + ARES_RR_AAAA_ADDR - ares_parse_ns_reply -> ares_dns_parse + ARES_RR_NS_NSDNAME - ares_parse_ptr_reply -> ares_dns_parse + ARES_RR_PTR_DNAME - ares_parse_mx_reply -> ares_dns_parse + ARES_RR_MX_* - ares_parse_caa_reply -> ares_dns_parse + ARES_RR_CAA_* - ares_parse_txt_reply_ext -> ares_dns_parse + ares_dns_rr_get_abin - ares_parse_srv_reply -> ares_dns_parse + ARES_RR_SRV_* - ares_parse_naptr_reply -> ares_dns_parse + ARES_RR_NAPTR_* - ares_parse_soa_reply -> ares_dns_parse + ARES_RR_SOA_* Server management (CSV-based APIs): - ares_get_servers_ports -> ares_get_servers_csv - ares_set_servers -> ares_set_servers_csv - ares_set_servers_ports -> ares_set_servers_ports_csv The new ares_dns_parse API parses DNS wire format into an ares_dns_record_t structure which is then iterated using typed getter functions (ares_dns_rr_get_addr, ares_dns_rr_get_str, ares_dns_rr_get_u16, etc.). This follows the same pattern already used by ParseTlsaReply in this file. Fixes: nodejs#52464
60968d8 to
7457b39
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace all deprecated c-ares function calls in cares_wrap.cc with
their modern equivalents, resolving all compiler deprecation warnings
reported in #52464.
DNS record parsing →
ares_dns_parse+ record iterationThe deprecated per-type parse functions are replaced with the unified
ares_dns_parse()API, which parses DNS wire format into anares_dns_record_tstructure. Records are then iterated using typedgetter functions. This follows the same pattern already used by
ParseTlsaReply in this file.
ares_parse_a_replyares_dns_parse+ARES_RR_A_ADDRares_parse_aaaa_replyares_dns_parse+ARES_RR_AAAA_ADDRares_parse_ns_replyares_dns_parse+ARES_RR_NS_NSDNAMEares_parse_ptr_replyares_dns_parse+ARES_RR_PTR_DNAMEares_parse_mx_replyares_dns_parse+ARES_RR_MX_*ares_parse_caa_replyares_dns_parse+ARES_RR_CAA_*ares_parse_txt_reply_extares_dns_parse+ares_dns_rr_get_abinares_parse_srv_replyares_dns_parse+ARES_RR_SRV_*ares_parse_naptr_replyares_dns_parse+ARES_RR_NAPTR_*ares_parse_soa_replyares_dns_parse+ARES_RR_SOA_*Server management → CSV-based APIs
ares_get_servers_portsares_get_servers_csvares_set_serversares_set_servers_csvares_set_servers_portsares_set_servers_ports_csvAlso removes the now-unused HostentToNames 3-argument overload
that was only called from the old ParseGeneralReply implementation.
Fixes: #52464