Skip to content

fix(chore/ipc): change from ReadWriteCloser to ReadWriter interface#494

Merged
joe0BAB merged 1 commit intomainfrom
fix/hijack/interface
Mar 18, 2026
Merged

fix(chore/ipc): change from ReadWriteCloser to ReadWriter interface#494
joe0BAB merged 1 commit intomainfrom
fix/hijack/interface

Conversation

@joe0BAB
Copy link
Collaborator

@joe0BAB joe0BAB commented Mar 18, 2026

The hijackHandler already itself takes care of closing the connection always (

defer conn.Close()
). Reducing the interface passed to the callback to what actually makes sense / is allowed helps simplifying callback implementations.

Signed-off-by: Johannes Großmann <grossmann.johannes@t-online.de>
@joe0BAB joe0BAB marked this pull request as ready for review March 18, 2026 08:44
@joe0BAB joe0BAB requested a review from Benehiko March 18, 2026 08:44
Copy link

@docker-agent docker-agent bot left a comment

Choose a reason for hiding this comment

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

Review Summary

Assessment: 🟢 APPROVE

This PR changes the hijacking callback interface from io.ReadWriteCloser to io.ReadWriter. The change is intentional and correctly implemented. The server maintains ownership of the connection lifecycle through a deferred Close() call in ServeHTTP, preventing resource leaks while still allowing callbacks to read and write. No bugs found in the changed code.

@joe0BAB joe0BAB merged commit c7985c5 into main Mar 18, 2026
17 checks passed
@joe0BAB joe0BAB deleted the fix/hijack/interface branch March 18, 2026 10:07
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