From fa5b5ca02d3620ddfb3d1b59dc3fbebe801692b5 Mon Sep 17 00:00:00 2001 From: wwqgtxx Date: Tue, 17 Jan 2023 21:36:16 +0800 Subject: [PATCH] fix: tcpTracker's upload --- tunnel/statistic/tracker.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tunnel/statistic/tracker.go b/tunnel/statistic/tracker.go index c034d75d..97dd7316 100644 --- a/tunnel/statistic/tracker.go +++ b/tunnel/statistic/tracker.go @@ -65,11 +65,8 @@ func (tt *tcpTracker) Write(b []byte) (int, error) { } func (tt *tcpTracker) WriteBuffer(buffer *buf.Buffer) (err error) { + upload := int64(buffer.Len()) err = tt.extendedWriter.WriteBuffer(buffer) - var upload int64 - if err != nil { - upload = int64(buffer.Len()) - } tt.manager.PushUploaded(upload) tt.UploadTotal.Add(upload) return