Code refactor to improve naming, logging and connection handling (GSoC2025/issue 161)#189
Open
furusiyya wants to merge 9 commits into
Open
Code refactor to improve naming, logging and connection handling (GSoC2025/issue 161)#189furusiyya wants to merge 9 commits into
furusiyya wants to merge 9 commits into
Conversation
Passthrough implementation
7b9ad0f to
20d95ae
Compare
Collaborator
Author
|
@glaslos This is ready from my side. Let me know if you’re okay with merging it into |
glaslos
requested changes
Apr 26, 2026
| g.Logger.Error("Failed to handle TCP connection", producer.ErrAttr(err), slog.String("handler", rule.Target)) | ||
| } | ||
| }() | ||
| if rule.Type == "proxy_tcp" { |
| } | ||
|
|
||
| func (r reader) Read(p []byte) (int, error) { | ||
|
|
Member
There was a problem hiding this comment.
no newline after function signature
|
|
||
| // A Write can partially succeed. Only p[:n] reached the destination, so only | ||
| // those bytes should affect logs, byte counts, and capture samples. | ||
| if n > 0 { |
Member
There was a problem hiding this comment.
I believe we should still handle the error first
Collaborator
Author
There was a problem hiding this comment.
Okay, so that means recording partial writes isn't useful when err!=nil. I will also update tests accordingly.
Collaborator
Author
There was a problem hiding this comment.
Please let me know if I understood your comment correctly.
Collaborator
Author
|
@glaslos, I've updated the PR, let me know if you have any additional comments. Thanks! |
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.
proxy_tcpto describe the active proxy behavior more clearly.Fixes #161