QHttpConnection: Create new streams returns error when ids are exhausted
CreateStream returns a new error code, StreamIdsExhausted, when next stream id counter exceeds max stream id instead of assert. Task-number: QTBUG-122375 Change-Id: I653b20c24c1429fe88d476beb1ca952aa1bbb320 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 9b386127a091ff12229709b4a60ad6d4e8b05512) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
5b3fd5e9d2
commit
b71a4b9a2f
@ -540,8 +540,9 @@ QHttp2Connection *QHttp2Connection::createDirectServerConnection(QIODevice *sock
|
||||
|
||||
QH2Expected<QHttp2Stream *, QHttp2Connection::CreateStreamError> QHttp2Connection::createStream()
|
||||
{
|
||||
Q_ASSERT(m_nextStreamID <= lastValidStreamID);
|
||||
Q_ASSERT(m_connectionType == Type::Client); // This overload is just for clients
|
||||
if (m_nextStreamID > lastValidStreamID)
|
||||
return { QHttp2Connection::CreateStreamError::StreamIdsExhausted };
|
||||
return createStreamInternal();
|
||||
}
|
||||
|
||||
|
@ -193,6 +193,7 @@ class Q_NETWORK_EXPORT QHttp2Connection : public QObject
|
||||
public:
|
||||
enum class CreateStreamError {
|
||||
MaxConcurrentStreamsReached,
|
||||
StreamIdsExhausted,
|
||||
ReceivedGOAWAY,
|
||||
};
|
||||
Q_ENUM(CreateStreamError)
|
||||
|
Loading…
x
Reference in New Issue
Block a user