8000 docs: add deprecation note for dns function by createyourpersonalaccount · Pull Request #910 · c-ares/c-ares · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

docs: add deprecation note for dns function #910

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 7, 2024

Conversation

createyourpersonalaccount
Copy link
Contributor

No description provided.

@createyourpersonalaccount
Copy link
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
Copy link
Member
bradh352 commented Nov 8, 2024

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
Copy link
Member
bradh352 commented Nov 8, 2024

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

@createyourpersonalaccount
Copy link
Contributor Author

@bradh352 does this look okay?

@bradh352
Copy link
Member
bradh352 commented Dec 6, 2024

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

@createyourpersonalaccount
Copy link
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
24 of 27 checks passed
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
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
0