mirror of https://github.com/qt/qtgrpc.git
QGrpcHttp2Channel: Remove unneeded check when creating stream
The `m_connection` check was not needed as there are two places where this is called: - inside createHttp2Connection() -> connection gets created, 100% valid - inside processOperation(), where we need the m_connection check anyways. Remove the check + error and replace it with an assert. Pick-to: 6.10 6.9 6.8 Change-Id: Ib1d8a16db65cadfecb242f54a27ab70bb08a78fd Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This commit is contained in:
parent
e48296e650
commit
5e969e8646
|
|
@ -1124,15 +1124,9 @@ void QGrpcHttp2ChannelPrivate::ensureSchemeIsValid(QLatin1String expected)
|
||||||
bool QGrpcHttp2ChannelPrivate::createHttp2Stream(Http2Handler *handler)
|
bool QGrpcHttp2ChannelPrivate::createHttp2Stream(Http2Handler *handler)
|
||||||
{
|
{
|
||||||
Q_ASSERT(handler != nullptr);
|
Q_ASSERT(handler != nullptr);
|
||||||
|
Q_ASSERT(m_connection);
|
||||||
|
|
||||||
auto *channelOpPtr = handler->operation();
|
auto *channelOpPtr = handler->operation();
|
||||||
if (!m_connection) {
|
|
||||||
operationContextAsyncError(channelOpPtr,
|
|
||||||
QGrpcStatus{ StatusCode::Unavailable,
|
|
||||||
tr("Unable to establish an HTTP/2 connection") });
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const auto streamAttempt = m_connection->createStream();
|
const auto streamAttempt = m_connection->createStream();
|
||||||
if (!streamAttempt.ok()) {
|
if (!streamAttempt.ok()) {
|
||||||
operationContextAsyncError(channelOpPtr,
|
operationContextAsyncError(channelOpPtr,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue