Correctly copy frame payload in frame sorter

pull/158/head
Andy Wang 3 years ago
parent f322f8b47f
commit 661db9d083
No known key found for this signature in database
GPG Key ID: 181B49F9F38F3374

@ -82,6 +82,8 @@ func (sb *streamBuffer) Write(f *Frame) (toBeClosed bool, err error) {
}
saved := *f
saved.Payload = make([]byte, len(f.Payload))
copy(saved.Payload, f.Payload)
heap.Push(&sb.sh, &saved)
// Keep popping from the heap until empty or to the point that the wanted seq was not received
for len(sb.sh) > 0 && sb.sh[0].Seq == sb.nextRecvSeq {

Loading…
Cancel
Save