Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Raspberry Pi port schedules a TCP abort callback when a socket has not closed cleanly. It converts its 10,000 ms close timeout to lwIP poll ticks using a fixed 500 ms divisor. This port configures a 50 ms lwIP slow timer, so the callback is scheduled after 20 ticks, roughly one second.
Use
TCP_SLOW_INTERVALfor the conversion and round up to a whole tick. On this port, 200 ticks give the intended ten-second timeout. Check at compile time that the tick count fits lwIP's eight-bit poll interval.Hardware validation
Built two Pico 2 W firmware images from upstream commit
931d0ec0ec35879b156ef23dde214c40d886eea9using separate build directories. The only source difference was this patch. Both ran the same HTTP application on the same board.For each trial, establish the TCP connection first. Before requesting the response, temporarily drop incoming response data for that connection at the client for two seconds, while allowing control packets through. The server closes the accepted socket with response data still unacknowledged. Remove the drop rule after two seconds and record whether the client receives the complete response or a TCP reset.
Earlier instrumentation on a 10.3.2-based build put the original close poll callback approximately 0.99 s after it was scheduled. The table measures from the earlier HTTP request and includes the application's 0.5 s close grace period.