Skip to content

perf(http): avoid downcast checks on non-Linux platforms#202

Merged
0x676e67 merged 1 commit intomainfrom
perf
Oct 2, 2025
Merged

perf(http): avoid downcast checks on non-Linux platforms#202
0x676e67 merged 1 commit intomainfrom
perf

Conversation

@0x676e67
Copy link
Copy Markdown
Owner

@0x676e67 0x676e67 commented Oct 2, 2025

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR optimizes HTTP tunnel performance by conditionally compiling downcast checks only on Linux platforms. On non-Linux platforms, the code now uses a direct bidirectional copy instead of attempting to downcast the upgraded connection to a TcpStream.

  • Adds conditional compilation attributes to separate Linux-specific and non-Linux code paths
  • Implements a simpler bidirectional copy for non-Linux platforms that avoids unnecessary downcast operations
Comments suppressed due to low confidence (1)

src/server/http/mod.rs:1

  • The variable res is declared within a conditional compilation block, but it's used unconditionally at line 322. This will cause a compilation error on non-Linux platforms where this variable is not defined in scope.
pub mod accept;

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@0x676e67 0x676e67 merged commit 9423929 into main Oct 2, 2025
2 checks passed
@0x676e67 0x676e67 deleted the perf branch October 2, 2025 15:38
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.

2 participants