Skip to content
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

Fix for TCP back to back queries #552

Merged
merged 14 commits into from Sep 28, 2023
Merged

Fix for TCP back to back queries #552

merged 14 commits into from Sep 28, 2023

Conversation

bradh352
Copy link
Member

@bradh352 bradh352 commented Sep 27, 2023

As per #266, TCP queries are basically broken. If we get a partial reply, things just don't work, but unlike UDP, TCP may get fragmented and we need to properly handle that.

I've started creating a basic parser/buffer framework for c-ares for memory safety reasons, but it also helps for things like this where we shouldn't be manually tracking positions and fetching only a couple of bytes at a time from a socket. This parser/buffer will be expanded and used more in the future.

This also resolves #206 by allowing NULL to be specified for some socket callbacks so they will auto-route to the built-in c-ares functions.

@bradh352 bradh352 merged commit fab4039 into c-ares:main Sep 28, 2023
26 checks passed
@bradh352 bradh352 deleted the tcpfix branch September 28, 2023 11:17
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.

ares_set_socket_functions API assumes HAVE_WRITEV=1
2 participants