新TAP测试(TODO 解析arp)

This commit is contained in:
黄思敏 2022-09-01 15:25:37 +08:00
parent 5861f07251
commit 63f0bd017a
2 changed files with 11 additions and 1 deletions

View File

@ -134,7 +134,7 @@ func NewNetTunnel() *NetTunnel {
client := v.(*RPCClient)
client.CheckConnect()
client.Push(frame)
log.Println(len(frame))
// log.Println(len(frame))
}
}

View File

@ -113,7 +113,17 @@ func (cli *RPCClient) run() {
if len(cli.Frames) == 0 {
return false
}
Compress(buf, cli.Frames)
if len(cli.Frames) >= 1000 {
var countbuf = 0
for _, frame := range cli.Frames {
countbuf += len(frame)
}
log.Printf("src size: %d compressed size: %d", countbuf, len(buf.Bytes()))
}
cli.Frames = cli.Frames[:0]
return true
}) {