HTTP Network Reply Impl: return earlier when resource loaded from cache

This commit is contained in:
Peter Hartmann 2011-04-08 14:54:45 +02:00 committed by Markus Goetz
parent 7876177c0c
commit 2aba57d58e

View File

@ -650,6 +650,10 @@ void QNetworkReplyHttpImplPrivate::postRequest()
break; // can't happen
}
if (loadedFromCache) {
return; // no need to send the request! :)
}
QList<QByteArray> headers = request.rawHeaderList();
if (resumeOffset != 0) {
if (headers.contains("Range")) {
@ -677,10 +681,6 @@ void QNetworkReplyHttpImplPrivate::postRequest()
foreach (const QByteArray &header, headers)
httpRequest.setHeaderField(header, request.rawHeader(header));
if (loadedFromCache) {
return; // no need to send the request! :)
}
if (request.attribute(QNetworkRequest::HttpPipeliningAllowedAttribute).toBool() == true)
httpRequest.setPipeliningAllowed(true);