Fix race codes

This commit is contained in:
世界
2025-09-12 18:04:44 +08:00
parent 709cdc1f95
commit 8df94f091f
9 changed files with 62 additions and 40 deletions

View File

@@ -163,15 +163,10 @@ func (c *STDServerConfig) certificateUpdated(path string) error {
if err != nil {
return E.Cause(err, "reload ECH keys from ", c.echKeyPath)
}
echKeys, err := parseECHKeys(echKey)
err = c.setECHServerConfig(echKey)
if err != nil {
return err
}
c.access.Lock()
config := c.config.Clone()
config.EncryptedClientHelloKeys = echKeys
c.config = config
c.access.Unlock()
c.logger.Info("reloaded ECH keys")
}
return nil