Skip to content

Fix for TCP back to back queries - #552

Merged
bradh352 merged 14 commits into
c-ares:mainfrom
bradh352:tcpfix
Sep 28, 2023
Merged

Fix for TCP back to back queries#552
bradh352 merged 14 commits into
c-ares:mainfrom
bradh352:tcpfix

Conversation

@bradh352

@bradh352 bradh352 commented Sep 27, 2023

Copy link
Copy Markdown
Member

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 requested a review from bagder September 27, 2023 11:18
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