Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions transport/internet/finalmask/fragment/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ func (c *fragmentConn) Splice() bool {
return true
}

type closeWriteConn interface {
CloseWrite() error
}

func (c *fragmentConn) CloseWrite() error {
if raw, ok := c.Conn.(closeWriteConn); ok {
return raw.CloseWrite()
}
return net.ErrClosed
}

// lengthForSegment returns the length range (min, max) for the given segment index (0-based).
// Clamps to the last entry when the index exceeds the list length.
func (c *fragmentConn) lengthForSegment(segIdx int) (int64, int64) {
Expand Down