start running TLS server session directly when creating them

This commit is contained in:
Marten Seemann
2018-05-20 13:56:26 +08:00
parent e98228df9d
commit ef34d9e85f
4 changed files with 23 additions and 9 deletions

View File

@@ -165,11 +165,9 @@ func (s *server) setupTLS() error {
case <-s.errorChan:
return
case tlsSession := <-sessionChan:
sess := tlsSession.sess
// The connection ID is a randomly chosen 8 byte value.
// It is safe to assume that it doesn't collide with other randomly chosen values.
s.sessionHandler.Add(tlsSession.connID, sess)
go sess.run()
s.sessionHandler.Add(tlsSession.connID, tlsSession.sess)
}
}
}()