From 15e53f1f521df842d77379877f7b7020f81ccd3a Mon Sep 17 00:00:00 2001 From: esrrhs Date: Sat, 26 Oct 2019 20:45:58 +0800 Subject: [PATCH] add --- cmd/main.go | 5 +++++ pingtunnel.go | 2 +- pingtunnel_test.go | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cmd/main.go b/cmd/main.go index fb4ad0a..c19998f 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/esrrhs/go-engine/src/loggo" "github.com/esrrhs/pingtunnel" + "strconv" ) var usage = ` @@ -70,6 +71,10 @@ func main() { flag.Usage() return } + if *tcpmode_maxwin*10 > pingtunnel.FRAME_MAX_ID { + fmt.Println("set tcp win to big max = " + strconv.Itoa(pingtunnel.FRAME_MAX_ID/10)) + return + } loggo.Ini(loggo.Config{Level: loggo.LEVEL_DEBUG, Prefix: "pingtunnel", MaxDay: 3}) loggo.Info("start...") diff --git a/pingtunnel.go b/pingtunnel.go index d0c13d0..6929f73 100644 --- a/pingtunnel.go +++ b/pingtunnel.go @@ -139,5 +139,5 @@ func GetMd5String(s string) string { const ( FRAME_MAX_SIZE int = 888 - FRAME_MAX_ID int = 10000 + FRAME_MAX_ID int = 100000 ) diff --git a/pingtunnel_test.go b/pingtunnel_test.go index 732e9e6..ded56f2 100644 --- a/pingtunnel_test.go +++ b/pingtunnel_test.go @@ -75,4 +75,8 @@ func Test0001(t *testing.T) { fm.recvid = 7 fm.windowsize = 5 fmt.Println("fm.isIdInRange = ", fm.isIdInRange(9, 10)) + + fm.recvid = 10 + fm.windowsize = 10000 + fmt.Println("fm.isIdInRange = ", fm.isIdInRange(0, FRAME_MAX_ID)) }