mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Add a panic that prints information about the sender before calling splitSeg.
It helps to know why splitSeg panics with a negative value. PiperOrigin-RevId: 661021651
This commit is contained in:
@@ -905,6 +905,11 @@ func (s *sender) maybeSendSegment(seg *segment, limit int, end seqnum.Value) (se
|
||||
if seg.payloadSize() > available {
|
||||
// A negative value causes splitSeg to panic anyways, so just panic
|
||||
// earlier to get more information about the cause.
|
||||
// TOOD(b/357457079): Remove this panic once the cause of negative values
|
||||
// of "available" is understood.
|
||||
if available < 0 {
|
||||
panic(fmt.Sprintf("got available=%d, want available>=0. limit %d, s.MaxPayloadSize %d, seg.payloadSize() %d, gso.MaxSize %d, gso.MSS %d", available, limit, s.MaxPayloadSize, seg.payloadSize(), s.ep.gso.MaxSize, s.ep.gso.MSS))
|
||||
}
|
||||
s.splitSeg(seg, available)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user