mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
crypto/tls: pass argument to serverInit rather than using a field in Config.
Updates #20164. Change-Id: Ib900095e7885f25cd779750674a712c770603ca8 Reviewed-on: https://go-review.googlesource.com/42137 Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
b53acd89db
commit
46f4bfb2d1
2 changed files with 8 additions and 19 deletions
|
|
@ -40,7 +40,7 @@ type serverHandshakeState struct {
|
|||
func (c *Conn) serverHandshake() error {
|
||||
// If this is the first server handshake, we generate a random key to
|
||||
// encrypt the tickets with.
|
||||
c.config.serverInitOnce.Do(c.config.serverInit)
|
||||
c.config.serverInitOnce.Do(func() { c.config.serverInit(nil) })
|
||||
|
||||
hs := serverHandshakeState{
|
||||
c: c,
|
||||
|
|
@ -129,11 +129,7 @@ func (hs *serverHandshakeState) readClientHello() (isResume bool, err error) {
|
|||
c.sendAlert(alertInternalError)
|
||||
return false, err
|
||||
} else if newConfig != nil {
|
||||
newConfig.mutex.Lock()
|
||||
newConfig.originalConfig = c.config
|
||||
newConfig.mutex.Unlock()
|
||||
|
||||
newConfig.serverInitOnce.Do(newConfig.serverInit)
|
||||
newConfig.serverInitOnce.Do(func() { newConfig.serverInit(c.config) })
|
||||
c.config = newConfig
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue