From 284dcccd18e7786899bb94bc81ed82cb5af095e6 Mon Sep 17 00:00:00 2001 From: esrrhs Date: Sat, 26 Oct 2019 21:26:19 +0800 Subject: [PATCH] add --- framemgr.go | 2 +- pingtunnel_test.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/framemgr.go b/framemgr.go index 0783151..05fbb75 100644 --- a/framemgr.go +++ b/framemgr.go @@ -231,7 +231,7 @@ func (fm *FrameMgr) addToRecvWin(rf *Frame) bool { if !fm.isIdInRange((int)(rf.Id), FRAME_MAX_ID) { loggo.Debug("recv frame not in range %d %d", rf.Id, fm.recvid) - if !fm.isIdOld((int)(rf.Id), FRAME_MAX_ID) { + if fm.isIdOld((int)(rf.Id), FRAME_MAX_ID) { return true } return false diff --git a/pingtunnel_test.go b/pingtunnel_test.go index 3a51a2b..c5ce26b 100644 --- a/pingtunnel_test.go +++ b/pingtunnel_test.go @@ -91,4 +91,8 @@ func Test0001(t *testing.T) { fm.recvid = 3 fm.windowsize = 5 fmt.Println("fm.isIdOld = ", fm.isIdOld(1, 10)) + + fm.recvid = 13 + fm.windowsize = 10000 + fmt.Println("fm.isIdOld = ", fm.isIdOld(9, FRAME_MAX_ID)) }