QNetworkDiskCache: avoid a 31-bit truncation

Network operations whose content size exceed 2G are not unheard of, and
they probably shouldn't be cached, so use the correct toX() function, one
that doesn't truncate the value in the header.

Change-Id: Ie4e68a3120c85952dd2cc9feb73c5844e20b9aa3
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
This commit is contained in:
Marc Mutz 2012-08-20 16:24:59 +02:00 committed by Qt by Nokia
parent 2f9f16a01c
commit 8967e731a6

View File

@ -197,7 +197,7 @@ QIODevice *QNetworkDiskCache::prepare(const QNetworkCacheMetaData &metaData)
foreach (const QNetworkCacheMetaData::RawHeader &header, metaData.rawHeaders()) {
if (header.first.toLower() == "content-length") {
qint64 size = header.second.toInt();
const qint64 size = header.second.toLongLong();
if (size > (maximumCacheSize() * 3)/4)
return 0;
break;