From ec45b72c396ba9551749e0ef07d9fcbdd7c9a386 Mon Sep 17 00:00:00 2001 From: xtaci Date: Fri, 9 Oct 2020 16:45:17 +0800 Subject: [PATCH] remove obsolete decoder in listener --- sess.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/sess.go b/sess.go index 6321ff4..f7053c3 100644 --- a/sess.go +++ b/sess.go @@ -777,7 +777,6 @@ type ( sessionLock sync.Mutex chAccepts chan *UDPSession // Listen() backlog chSessionClosed chan net.Addr // session close queue - headerSize int // the additional header to a KCP frame die chan struct{} // notify the listener has closed dieOnce sync.Once @@ -1018,17 +1017,7 @@ func serveConn(block BlockCrypt, dataShards, parityShards int, conn net.PacketCo l.dataShards = dataShards l.parityShards = parityShards l.block = block - l.fecDecoder = newFECDecoder(dataShards, parityShards) l.chSocketReadError = make(chan struct{}) - - // calculate header size - if l.block != nil { - l.headerSize += cryptHeaderSize - } - if l.fecDecoder != nil { - l.headerSize += fecHeaderSizePlus2 - } - go l.monitor() return l, nil }