Skip to content

Fixed a infinite loop, updated libQuic, disabled MTU discovery and C API tweaks #39

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

Conversation

mpretty-cyro
Copy link
Collaborator

@mpretty-cyro mpretty-cyro commented Apr 4, 2025

This PR contains 3 changes:

Fixed an infinite loop when refreshing the snode cache
We weren't defaulting the in_progress_snode_cache_refresh_count to 0 which meant when Network::refresh_snode_cache was called the recursive logic below would be called and when in_progress_snode_cache_refresh_count evaluated to a negative value it would just recurse endlessly

if (in_progress_snode_cache_refresh_count < num_snodes_to_refresh_cache_from)
        loop->call_soon([this, request_id]() { refresh_snode_cache(request_id); });

By defaulting the value to 0 this should no longer occur

Updated libQuic and disabled MTU discovery
Updated to the latest version of libQuic which adds the option to disable MTU discovery, this has been added to the network instance for the time being (in the future it'd be good to try to fix this a different way)

C API Tweaks
Updated a number of the C functions to take const char* const* instead of const char**

@mpretty-cyro mpretty-cyro added the bug Something isn't working label Apr 4, 2025
@mpretty-cyro mpretty-cyro requested a review from jagerman April 4, 2025 02:11
@mpretty-cyro mpretty-cyro self-assigned this Apr 4, 2025
@mpretty-cyro mpretty-cyro changed the title Fixed an infinite loop when refreshing the snode cache Fixed a infinite loop, updated libQuic and C API tweaks Apr 6, 2025
@mpretty-cyro mpretty-cyro changed the title Fixed a infinite loop, updated libQuic and C API tweaks Fixed a infinite loop, updated libQuic, disabled MTU discovery and C API tweaks Apr 6, 2025
• Updated some C types from `const char**` to `const char* const*` to fix up the Swift interface
• Updated to the latest libQuic and disabled MTU discovery (caused issues with some networks)
@mpretty-cyro mpretty-cyro merged commit 201b37f into session-foundation:dev Apr 7, 2025
1 check passed
@mpretty-cyro mpretty-cyro deleted the fix/snode-cache-rebuild-infinite-loop branch April 7, 2025 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants