From 63f0bd017aed03830e6d63535b08a5b2f8345946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=80=9D=E6=95=8F?= Date: Thu, 1 Sep 2022 15:25:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0TAP=E6=B5=8B=E8=AF=95(TODO=20=E8=A7=A3?= =?UTF-8?q?=E6=9E=90arp)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- netcard.go | 2 +- rpc_client.go | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/netcard.go b/netcard.go index 6822d29..504dc6c 100644 --- a/netcard.go +++ b/netcard.go @@ -134,7 +134,7 @@ func NewNetTunnel() *NetTunnel { client := v.(*RPCClient) client.CheckConnect() client.Push(frame) - log.Println(len(frame)) + // log.Println(len(frame)) } } diff --git a/rpc_client.go b/rpc_client.go index 3001de0..ea4396f 100644 --- a/rpc_client.go +++ b/rpc_client.go @@ -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 }) {