fix panic when probe packet containing a PATH_RESPONSE is lost (#5063)

This commit is contained in:
Marten Seemann
2025-04-20 10:49:59 +08:00
committed by GitHub
parent a1aa369464
commit 65d75f1ffb
2 changed files with 11 additions and 4 deletions

View File

@@ -179,8 +179,10 @@ var _ ackhandler.FrameHandler = &pathManagerAckHandler{}
func (pm *pathManagerAckHandler) OnAcked(f wire.Frame) {}
func (pm *pathManagerAckHandler) OnLost(f wire.Frame) {
// TODO: retransmit the packet the first time it is lost
pc := f.(*wire.PathChallengeFrame)
pc, ok := f.(*wire.PathChallengeFrame)
if !ok {
return
}
for i, path := range pm.paths {
if path.pathChallenge == pc.Data {
pm.paths = slices.Delete(pm.paths, i, i+1)