fix: tuic server goroutine leak

This commit is contained in:
wwqgtxx 2025-08-30 09:48:01 +08:00
parent 545d9b844d
commit 4188277b61

View File

@ -87,7 +87,11 @@ func (s *serverHandler) handle() {
_ = s.handleMessage() _ = s.handleMessage()
}() }()
<-s.quicConn.HandshakeComplete() select {
case <-s.quicConn.HandshakeComplete(): // this chan maybe not closed if handshake never complete
case <-time.After(s.quicConn.Config().HandshakeIdleTimeout): // HandshakeIdleTimeout in real conn.Config() never be zero
}
time.AfterFunc(s.AuthenticationTimeout, func() { time.AfterFunc(s.AuthenticationTimeout, func() {
if s.v4Handler != nil { if s.v4Handler != nil {
if s.v4Handler.AuthOk() { if s.v4Handler.AuthOk() {