forked from quic-go/quic-go
introduce a StreamLimitReachedError for Connection.Open{Uni}Stream (#4579)
Using a concrete type is preferable to relying on interpreting the return values from net.Error.Timeout and net.Error.Temporary, especially since the latter has been deprecated since Go 1.18.
This commit is contained in:
@@ -60,7 +60,7 @@ func (m *outgoingStreamsMap[T]) OpenStream() (T, error) {
|
||||
// if there are OpenStreamSync calls waiting, return an error here
|
||||
if len(m.openQueue) > 0 || m.nextStream > m.maxStream {
|
||||
m.maybeSendBlockedFrame()
|
||||
return *new(T), streamOpenErr{errTooManyOpenStreams}
|
||||
return *new(T), streamOpenErr{&StreamLimitReachedError{}}
|
||||
}
|
||||
return m.openStream(), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user