Skip to content

docs: add deprecation note for dns function#910

Merged
bradh352 merged 6 commits into
c-ares:mainfrom
createyourpersonalaccount:fix-docs
Dec 7, 2024
Merged

docs: add deprecation note for dns function#910
bradh352 merged 6 commits into
c-ares:mainfrom
createyourpersonalaccount:fix-docs

Conversation

@createyourpersonalaccount

Copy link
Copy Markdown
Contributor

No description provided.

@createyourpersonalaccount

Copy link
Copy Markdown
Contributor Author

Hm, I've noticed that I get an ARES_EBADRESP even though I haven't configured a DNS server for the channel nor a query for the record. Is this a bug? The situation is:

ares_init_options(&channel, &options, ARES_OPT_EVENT_THREAD);
ares_dns_record_create(&dnsrec, 0, 0, ARES_OPCODE_QUERY, 0);
ares_send_dnsrec(channel, dnsrec, callback, NULL, &query_id);
ares_dns_record_destroy(dnsrec);
ares_destroy(channel);
ares_library_cleanup();
exit(0);

I know that I'm supposed to wait for the query, I'm just wondering if ARES_EBADRESP is an appropriate status in this situation for the callback.

@bradh352

bradh352 commented Nov 8, 2024

Copy link
Copy Markdown
Member

Its possible that this is a bad error code, it maybe should be ARES_EBADQUERY since your query isn't properly formed, you're missing the actual question, use ares_dns_record_query_add(). My guess is its this line that's generating that error code:

status = ares_dns_record_duplicate_ex(&query->query, dnsrec);

The duplicate query writes out the query as binary, then parses it into a new data structure. The parse likely failed due to missing the question hence ARES_EBADRESP since a parser is typically used on responses. I probably need to look at the duplicate function and catch this to rewrite the error code.

@bradh352

bradh352 commented Nov 8, 2024

Copy link
Copy Markdown
Member

the status code should be better reflected in 91519e7 if I'm correct

Comment thread docs/ares_create_query.3
Comment thread docs/ares_mkquery.3 Outdated
Comment thread docs/ares_send.3 Outdated
@createyourpersonalaccount

Copy link
Copy Markdown
Contributor Author

@bradh352 does this look okay?

@bradh352

bradh352 commented Dec 6, 2024

Copy link
Copy Markdown
Member

ARES_ENOSERVER is definitely a valid return code to ares_send() and friends, why did it get removed?

@createyourpersonalaccount

Copy link
Copy Markdown
Contributor Author

ARES_ENOSERVER is definitely a valid return code to ares_send() and friends, why did it get removed?

Oops! I meant to change the status I introduced, ARES_EBADRESP, not ARES_ENOSERVER.

@bradh352 bradh352 merged commit dbd3f29 into c-ares:main Dec 7, 2024
bradh352 pushed a commit that referenced this pull request Dec 7, 2024
bradh352 pushed a commit that referenced this pull request Dec 7, 2024
bradh352 pushed a commit that referenced this pull request Dec 7, 2024
bradh352 pushed a commit that referenced this pull request Dec 7, 2024
bradh352 pushed a commit that referenced this pull request Dec 7, 2024
michael-dev pushed a commit to HamelinPorts/android_external_c-ares that referenced this pull request Apr 25, 2026
michael-dev pushed a commit to HamelinPorts/android_external_c-ares that referenced this pull request Apr 25, 2026
michael-dev pushed a commit to HamelinPorts/android_external_c-ares that referenced this pull request Apr 25, 2026
michael-dev pushed a commit to HamelinPorts/android_external_c-ares that referenced this pull request Apr 25, 2026
michael-dev pushed a commit to HamelinPorts/android_external_c-ares that referenced this pull request Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants