rename the constructors for the various qerr.Error flavors

This commit is contained in:
Marten Seemann 2020-03-21 10:53:03 +07:00
parent 2f2583beb0
commit 6d61dccc2f
16 changed files with 69 additions and 69 deletions

View file

@ -40,12 +40,12 @@ func newCryptoStream() cryptoStream {
func (s *cryptoStreamImpl) HandleCryptoFrame(f *wire.CryptoFrame) error {
highestOffset := f.Offset + protocol.ByteCount(len(f.Data))
if maxOffset := highestOffset; maxOffset > protocol.MaxCryptoStreamOffset {
return qerr.Error(qerr.CryptoBufferExceeded, fmt.Sprintf("received invalid offset %d on crypto stream, maximum allowed %d", maxOffset, protocol.MaxCryptoStreamOffset))
return qerr.NewError(qerr.CryptoBufferExceeded, fmt.Sprintf("received invalid offset %d on crypto stream, maximum allowed %d", maxOffset, protocol.MaxCryptoStreamOffset))
}
if s.finished {
if highestOffset > s.highestOffset {
// reject crypto data received after this stream was already finished
return qerr.Error(qerr.ProtocolViolation, "received crypto data after change of encryption level")
return qerr.NewError(qerr.ProtocolViolation, "received crypto data after change of encryption level")
}
// ignore data with a smaller offset than the highest received
// could e.g. be a retransmission