Skip to content
Open
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
10 changes: 10 additions & 0 deletions internal/socket/duplex.go
Original file line number Diff line number Diff line change
Expand Up @@ -1092,10 +1092,20 @@ func (dc *DuplexConnection) sendPayload(
}
dc.doSplit(d, m, func(index int, result fragmentation.SplitResult) {
flag := result.Flag
isLastFragment := !result.Flag.Check(core.FlagFollow)

if index == 0 {
flag |= frameFlag
// Remove (C)omplete flag, unless this is the last fragment.
if !isLastFragment {
flag &^= core.FlagComplete
}
} else {
flag |= core.FlagNext
// Set (C)omplete flag, if the original frame had it and this is the last fragment.
if isLastFragment && frameFlag.Check(core.FlagComplete) {
flag |= core.FlagComplete
}
}

// lazy release at last frame
Expand Down
Loading