QNetworkReplyHttpImpl: resolve a todo after the bearer removal
Not quite "next commit" like I wrote originally, but better late than never. As the comment said (and the code shows) it only returns true now so the extra function and if-check isn't needed anymore. Change-Id: I9e8fb8891a116475ab78c3848d7cfcdb659ac521 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
parent
a6d475d7db
commit
c2085c26cf
@ -1180,8 +1180,8 @@ void QNetworkReplyHttpImplPrivate::followRedirect()
|
|||||||
if (managerPrivate->thread)
|
if (managerPrivate->thread)
|
||||||
managerPrivate->thread->disconnect();
|
managerPrivate->thread->disconnect();
|
||||||
|
|
||||||
QMetaObject::invokeMethod(q, "start", Qt::QueuedConnection,
|
QMetaObject::invokeMethod(
|
||||||
Q_ARG(QNetworkRequest, redirectRequest));
|
q, [this]() { postRequest(redirectRequest); }, Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QNetworkReplyHttpImplPrivate::checkForRedirect(const int statusCode)
|
void QNetworkReplyHttpImplPrivate::checkForRedirect(const int statusCode)
|
||||||
@ -1731,33 +1731,14 @@ void QNetworkReplyHttpImplPrivate::setResumeOffset(quint64 offset)
|
|||||||
resumeOffset = offset;
|
resumeOffset = offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
|
||||||
Starts the backend. Returns \c true if the backend is started. Returns \c false if the backend
|
|
||||||
could not be started due to an unopened or roaming session. The caller should recall this
|
|
||||||
function once the session has been opened or the roaming process has finished.
|
|
||||||
*/
|
|
||||||
bool QNetworkReplyHttpImplPrivate::start(const QNetworkRequest &newHttpRequest)
|
|
||||||
{
|
|
||||||
postRequest(newHttpRequest);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QNetworkReplyHttpImplPrivate::_q_startOperation()
|
void QNetworkReplyHttpImplPrivate::_q_startOperation()
|
||||||
{
|
{
|
||||||
Q_Q(QNetworkReplyHttpImpl);
|
|
||||||
if (state == Working) // ensure this function is only being called once
|
if (state == Working) // ensure this function is only being called once
|
||||||
return;
|
return;
|
||||||
|
|
||||||
state = Working;
|
state = Working;
|
||||||
|
|
||||||
if (!start(request)) { // @todo next commit: cleanup, start now always returns true
|
postRequest(request);
|
||||||
qWarning("Backend start failed");
|
|
||||||
QMetaObject::invokeMethod(q, "_q_error", synchronous ? Qt::DirectConnection : Qt::QueuedConnection,
|
|
||||||
Q_ARG(QNetworkReply::NetworkError, QNetworkReply::UnknownNetworkError),
|
|
||||||
Q_ARG(QString, QCoreApplication::translate("QNetworkReply", "backend start error.")));
|
|
||||||
QMetaObject::invokeMethod(q, "_q_finished", synchronous ? Qt::DirectConnection : Qt::QueuedConnection);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
setupTransferTimeout();
|
setupTransferTimeout();
|
||||||
if (synchronous) {
|
if (synchronous) {
|
||||||
|
@ -98,7 +98,6 @@ public:
|
|||||||
|
|
||||||
Q_DECLARE_PRIVATE(QNetworkReplyHttpImpl)
|
Q_DECLARE_PRIVATE(QNetworkReplyHttpImpl)
|
||||||
Q_PRIVATE_SLOT(d_func(), void _q_startOperation())
|
Q_PRIVATE_SLOT(d_func(), void _q_startOperation())
|
||||||
Q_PRIVATE_SLOT(d_func(), bool start(const QNetworkRequest &))
|
|
||||||
Q_PRIVATE_SLOT(d_func(), void _q_cacheLoadReadyRead())
|
Q_PRIVATE_SLOT(d_func(), void _q_cacheLoadReadyRead())
|
||||||
Q_PRIVATE_SLOT(d_func(), void _q_bufferOutgoingData())
|
Q_PRIVATE_SLOT(d_func(), void _q_bufferOutgoingData())
|
||||||
Q_PRIVATE_SLOT(d_func(), void _q_bufferOutgoingDataFinished())
|
Q_PRIVATE_SLOT(d_func(), void _q_bufferOutgoingDataFinished())
|
||||||
@ -164,7 +163,6 @@ public:
|
|||||||
QNetworkReplyHttpImplPrivate();
|
QNetworkReplyHttpImplPrivate();
|
||||||
~QNetworkReplyHttpImplPrivate();
|
~QNetworkReplyHttpImplPrivate();
|
||||||
|
|
||||||
bool start(const QNetworkRequest &newHttpRequest);
|
|
||||||
void _q_startOperation();
|
void _q_startOperation();
|
||||||
|
|
||||||
void _q_cacheLoadReadyRead();
|
void _q_cacheLoadReadyRead();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user