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 Pick-to: 6.7 Change-Id: I653b20c24c1429fe88d476beb1ca952aa1bbb320 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
parent
03bd62e7c7
commit
9b386127a0
@ -793,8 +793,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