Repository navigation
Conversation
Both servers stopped reading after the first TCP segment, so a request larger than one segment was parsed truncated. Keep reading until CRLF CRLF (RFC 9112); POST bodies are still read by their handler. http_tcp_server.c also sets a 30 s SO_RCVTIMEO on accepted sockets, as new_tcp_server.c does. Co-authored-by: Claude <noreply@anthropic.com>
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.
Both HTTP servers stopped reading as soon as
recvreturned less than the free space, that is after the first TCP segment. A request larger than one segment (about 1460 bytes on a LAN, less through a VPN) was parsed truncated ("invalid request") and the connection closed without a response. Details in #2303./api/ota,/api/lfs/) are still read by their handler, as before.http_tcp_server.c(the server built for BK7231N/T) now sets a 30 sSO_RCVTIMEOon accepted sockets, asnew_tcp_server.calready does, so a silent client cannot hold the thread.Measured on
http_tcp_server.con a CB3S (BK7231N) through a WireGuard tunnel (MTU 1360), GET commands of 1400 to 3000 characters: 18 failures out of 210 at 1400 characters before, 0 out of 1597 after (together with the SDK realloc fix of the same issue). The change innew_tcp_server.cis the same loop but is not tested on hardware. Builds for BK7231N and BK7231T.Done with the help of Claude (Anthropic).