don't use net.Errors for streams map error (#5060)

This commit is contained in:
Marten Seemann
2025-04-19 22:16:47 +08:00
committed by GitHub
parent 9e1afd4fb4
commit a1aa369464
4 changed files with 14 additions and 43 deletions

View File

@@ -2,9 +2,7 @@ package quic
import (
"context"
"errors"
"fmt"
"net"
"sync"
"github.com/quic-go/quic-go/internal/flowcontrol"
@@ -34,19 +32,6 @@ func convertStreamError(err error, stype protocol.StreamType, pers protocol.Pers
return fmt.Errorf(strError.Error(), ids...)
}
type streamOpenErr struct{ error }
var _ net.Error = &streamOpenErr{}
func (streamOpenErr) Timeout() bool { return false }
func (e streamOpenErr) Unwrap() error { return e.error }
func (e streamOpenErr) Temporary() bool {
// In older versions of quic-go, the stream limit error was documented to be a net.Error.Temporary.
// This function was since deprecated, but we keep the existing behavior.
return errors.Is(e, &StreamLimitReachedError{})
}
// StreamLimitReachedError is returned from Connection.OpenStream and Connection.OpenUniStream
// when it is not possible to open a new stream because the number of opens streams reached
// the peer's stream limit.