Repository navigation
v. 0.7.0 Keep-Alive functionality - #9
Conversation
…g handle function in server.rs
…ent project state.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 441889501e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| Body::File(file) => { | ||
| tokio::io::copy(file, &mut stream).await?; | ||
| if connection_type.eq_ignore_ascii_case("close") { |
There was a problem hiding this comment.
Parse
Connection tokens before reusing the socket
The keep-alive loop only stops when connection_type.eq_ignore_ascii_case("close"), but connection_type is the raw header value and HTTP allows comma-separated tokens. For requests like Connection: keep-alive, close (which can appear after header coalescing), this check is false, so the server incorrectly keeps the connection open and waits for timeout even though the client requested closure. This can leave unnecessary open sockets under load; parse the header into tokens and treat any close token as terminal (and emit a canonical Connection: close).
Useful? React with 👍 / 👎.
I am very happy to introduce keep-alive functionality in Ferrox as of v. 0.7.0.
This includes:
Connection&Keep-Alive.rustfmtandOpenAI - Codex(doesn't affect functionality, only readability of code).