summaryrefslogtreecommitdiffstats
path: root/src/network/access/qhttpthreaddelegate.cpp
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2020-05-13 11:04:28 +0200
committerMårten Nordheim <marten.nordheim@qt.io>2021-06-12 00:04:04 +0200
commit6f25051536c1636688a0a0939196007aac34676d (patch)
tree390fc3fc4e0147a51d56aee6d563614b77981b6a /src/network/access/qhttpthreaddelegate.cpp
parentf9b867216ba2728ff993020599f5062e2f023de1 (diff)
QNetworkReply: Decompress when reading
Rather than when the data is received. Source compatibility is achieved through double-decompressing the data. This lets us know how many bytes are available just as before but without having the uncompressed data left in memory. Fixes: QTBUG-83269 Change-Id: I352bd09581614c582e4628243e2a0e895ba4946b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/network/access/qhttpthreaddelegate.cpp')
-rw-r--r--src/network/access/qhttpthreaddelegate.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/network/access/qhttpthreaddelegate.cpp b/src/network/access/qhttpthreaddelegate.cpp
index 05b720c4df..48e7953616 100644
--- a/src/network/access/qhttpthreaddelegate.cpp
+++ b/src/network/access/qhttpthreaddelegate.cpp
@@ -545,6 +545,7 @@ void QHttpThreadDelegate::synchronousFinishedSlot()
incomingErrorCode = statusCodeFromHttp(httpReply->statusCode(), httpRequest.url());
}
+ isCompressed = httpReply->isCompressed();
synchronousDownloadData = httpReply->readAll();
QMetaObject::invokeMethod(httpReply, "deleteLater", Qt::QueuedConnection);
@@ -634,6 +635,7 @@ void QHttpThreadDelegate::headerChangedSlot()
incomingContentLength = httpReply->contentLength();
removedContentLength = httpReply->removedContentLength();
isHttp2Used = httpReply->isHttp2Used();
+ isCompressed = httpReply->isCompressed();
emit downloadMetaData(incomingHeaders,
incomingStatusCode,
@@ -642,7 +644,8 @@ void QHttpThreadDelegate::headerChangedSlot()
downloadBuffer,
incomingContentLength,
removedContentLength,
- isHttp2Used);
+ isHttp2Used,
+ isCompressed);
}
void QHttpThreadDelegate::synchronousHeaderChangedSlot()