Skip to content

v. 0.7.0 Keep-Alive functionality - #9

Merged
Res-NeoTech merged 3 commits into
masterfrom
feat/keep-alive
Apr 5, 2026
Merged

Res-NeoTech merged 3 commits into
masterfrom
feat/keep-alive

Conversation

@Res-NeoTech

Copy link
Copy Markdown
Owner

I am very happy to introduce keep-alive functionality in Ferrox as of v. 0.7.0.

This includes:

  1. Full Keep-Alive handling with leftover body, loop and timeout.
  2. Detection of connection type based on headers and protocol version.
  3. Implementation of headers like Connection & Keep-Alive.
  4. Code formatting improvements automated by rustfmt and OpenAI - Codex (doesn't affect functionality, only readability of code).

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/server.rs
}
Body::File(file) => {
tokio::io::copy(file, &mut stream).await?;
if connection_type.eq_ignore_ascii_case("close") {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@Res-NeoTech
Res-NeoTech merged commit 168c8f1 into master Apr 5, 2026
1 check passed
@Res-NeoTech
Res-NeoTech deleted the feat/keep-alive branch April 7, 2026 00:00
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.

1 participant