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

net_http refactor #17460

Merged
merged 9 commits into from
Jan 23, 2025
Merged

Conversation

warmenhoven
Copy link
Contributor

There are a few little improvements that should help both with avoiding blocking the task queue excessively as well as hopefully slightly improving performance and reducing calls to realloc:

  • dns cache
  • dns resolution in separate thread
  • connection pool
  • start with a bigger receive buffer (16k vs 512 bytes)
  • realloc receive buffer based on Content-Length header

This doesn't change any of the APIs or usage. Hopefully it makes the function that does all the work, net_http_update, a little easier to read and understand; it doesn't really change any of the logic from it though.

The goal is to move calls to getaddrinfo() and connect() into
net_http_update(). This will make it possible for them to be replaced
with non-blocking alternatives later.

The net_http calling pattern right now allows callers to create the
http_connection_t, call net_http_new() which creates the http_t from
the http_connection_t, free the http_connection_t, and then start
calling net_http_update(). In order to preserve that, the http_t needs
to copy the values out of the http_connection_t on create. This also
preserves the http_connection_t values instead of freeing them, so the
connection would be able to be used later.
@warmenhoven
Copy link
Contributor Author

The checks include the gitlab CI run: https://git.libretro.com/libretro/RetroArch/-/pipelines/330951

@LibretroAdmin LibretroAdmin merged commit d2eb49c into libretro:master Jan 23, 2025
31 checks passed
@warmenhoven warmenhoven deleted the warmenhoven/pr/net-http branch January 23, 2025 01:57
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