From 78b422c3415d99713cac98137a9ebad6571eb937 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Wed, 2 Jan 2019 13:11:47 +0100 Subject: QNetworkReplyHttpImpl::_q_startOperation - remove a useless warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since it explains nothing and now, after some other bug was fixed (see, for example, c89d0f9d532), we trigger this message on the first request, which happens because: - 'createSession()' indeed, creates a session, compares a previous kwnon state (which happens to be 'Invalid') with a current state, which is 'Connected' and then invokes '_q_networkSessionStateChanged'. - '_q_networkSessionStateChanged()' on 'Connected' emits 'networkSessionConnected()' to which a newly-created QNetworkReplyHttpImpl will respond with it's _q_startOperation(). - QHttpNetworkReplyImpl will also try to 'open' a session, its 'opened()' signal will trigger, again, 'networkSessionConnected()' and ... the next _q_startOperation(). Now, not to add even more twisted spaghetti if/conditions with some unpredictable regressions, let's suppress a useless warning and silently return. We, indeed, in 'Working' state, let's keep working. Task-number: QTBUG-72463 Change-Id: I5282979920915ffded889c20b8ae740a46efef04 Reviewed-by: MÃ¥rten Nordheim --- src/network/access/qnetworkreplyhttpimpl.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp index ed2235ad28..ef54c198ba 100644 --- a/src/network/access/qnetworkreplyhttpimpl.cpp +++ b/src/network/access/qnetworkreplyhttpimpl.cpp @@ -1879,11 +1879,9 @@ void QNetworkReplyHttpImplPrivate::_q_startOperation() { Q_Q(QNetworkReplyHttpImpl); - // ensure this function is only being called once - if (state == Working) { - qDebug() << "QNetworkReplyHttpImplPrivate::_q_startOperation was called more than once" << url; + if (state == Working) // ensure this function is only being called once return; - } + state = Working; #ifndef QT_NO_BEARERMANAGEMENT -- cgit v1.2.3