forked from quic-go/quic-go
fix data race in client crypto setup
This commit is contained in:
@@ -323,6 +323,9 @@ func (h *cryptoSetupClient) GetSealer() (protocol.EncryptionLevel, Sealer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (h *cryptoSetupClient) GetSealerWithEncryptionLevel(encLevel protocol.EncryptionLevel) (Sealer, error) {
|
func (h *cryptoSetupClient) GetSealerWithEncryptionLevel(encLevel protocol.EncryptionLevel) (Sealer, error) {
|
||||||
|
h.mutex.RLock()
|
||||||
|
defer h.mutex.RUnlock()
|
||||||
|
|
||||||
switch encLevel {
|
switch encLevel {
|
||||||
case protocol.EncryptionUnencrypted:
|
case protocol.EncryptionUnencrypted:
|
||||||
return h.sealUnencrypted, nil
|
return h.sealUnencrypted, nil
|
||||||
|
|||||||
Reference in New Issue
Block a user