forked from quic-go/quic-go
Merge pull request #1959 from lucas-clemente/optimize-crypto-packet-sending
optimize sending of crypto packets
This commit is contained in:
@@ -552,6 +552,9 @@ func (h *cryptoSetup) GetInitialSealer() (LongHeaderSealer, error) {
|
||||
h.mutex.Lock()
|
||||
defer h.mutex.Unlock()
|
||||
|
||||
if h.initialSealer == nil {
|
||||
return nil, ErrKeysDropped
|
||||
}
|
||||
return h.initialSealer, nil
|
||||
}
|
||||
|
||||
@@ -560,6 +563,9 @@ func (h *cryptoSetup) GetHandshakeSealer() (LongHeaderSealer, error) {
|
||||
defer h.mutex.Unlock()
|
||||
|
||||
if h.handshakeSealer == nil {
|
||||
if h.initialSealer == nil {
|
||||
return nil, ErrKeysDropped
|
||||
}
|
||||
return nil, errors.New("CryptoSetup: no sealer with encryption level Handshake")
|
||||
}
|
||||
return h.handshakeSealer, nil
|
||||
|
||||
Reference in New Issue
Block a user