forked from quic-go/quic-go
use the correct error code for crypto stream errors
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package quic
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
@@ -81,7 +80,7 @@ func (s *cryptoStreamImpl) GetCryptoData() []byte {
|
||||
|
||||
func (s *cryptoStreamImpl) Finish() error {
|
||||
if s.queue.HasMoreData() {
|
||||
return errors.New("encryption level changed, but crypto stream has more data to read")
|
||||
return qerr.NewError(qerr.ProtocolViolation, "encryption level changed, but crypto stream has more data to read")
|
||||
}
|
||||
s.finished = true
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user