diff --git a/src/grpc/qgrpchttp2channel.cpp b/src/grpc/qgrpchttp2channel.cpp index f8f682c6..487700cf 100644 --- a/src/grpc/qgrpchttp2channel.cpp +++ b/src/grpc/qgrpchttp2channel.cpp @@ -435,7 +435,6 @@ Http2Handler::Http2Handler(QGrpcHttp2ChannelPrivate *parent, QGrpcOperationConte &Http2Handler::writeMessage); } - connect(context, &QGrpcOperationContext::finished, &m_deadlineTimer, &QTimer::stop); m_deadlineTimer.setSingleShot(true); writeMessage(context->argument()); @@ -696,6 +695,7 @@ void Http2Handler::finish(const QGrpcStatus &status) return; if (m_state != State::Cancelled) // don't overwrite the Cancelled state m_state = State::Finished; + m_deadlineTimer.stop(); emit m_context->finished(status); deleteLater(); } @@ -713,9 +713,6 @@ void Http2Handler::cancelWithStatus(const QGrpcStatus &status) qCDebug(lcStream, "[%p] Cancelling (state=%s)", this, QDebug::toBytes(m_state).data()); m_state = State::Cancelled; - // Client cancelled the stream before the deadline exceeded. - m_deadlineTimer.stop(); - // Immediate cancellation by sending the RST_STREAM frame. if (m_stream && !m_stream->sendRST_STREAM(Http2::Http2Error::CANCEL)) { qCDebug(lcStream, "[%p] Failed cancellation (stream=%p)", this, m_stream.get());