Skip to content

connection handling modularization#857

Merged
bradh352 merged 2 commits into
c-ares:mainfrom
bradh352:conn_modularize
Aug 18, 2024
Merged

connection handling modularization#857
bradh352 merged 2 commits into
c-ares:mainfrom
bradh352:conn_modularize

Conversation

@bradh352
Copy link
Copy Markdown
Member

The main purpose of this PR is to modularize the communication library, and streamline the code paths for TCP and UDP into a single flow. This will help us add additional flows such as TLS, and also make sure these communication functions return a known set of error codes so that additional error codes can be added for new flows in the future.

It also adds a new optional callback of ares_set_notify_pending_write_callback() that will assist in aggregating data from multiple queries into a single write operation. This doesn't apply to UDP, but on TCP and especially TLS in the future this can be a significant win. This is automatically applied for the Event Thread.

It also fixes a long standing issue if UDP connection became saturated and started returning EWOULDBLOCK or EAGAIN it was treated as a failure. Since this is more inline with the TCP code now, it will wait on a write event to retry.

Finally there are additional cleanups due to not needing to be able to retrieve socket errnos all over the place.

Authored-By: Brad House (@bradh352)

@bradh352 bradh352 merged commit d4ecf95 into c-ares:main Aug 18, 2024
@bradh352 bradh352 deleted the conn_modularize branch August 18, 2024 16:37
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.

1 participant