[Qt-interest] QNetworkReplyImplPrivate caching bug

Pascal Patry iscy at invalidip.com
Mon Jun 8 23:17:42 CEST 2009


1. Enable caching on Webkit
2. Store something bigger than 32k (for instance, a jpeg)
3. Load it from the cache
 => An error message shows up: Corrupt JPEG data: premature end of data 
segment

This is caused by QNetworkReplyImplPrivate never getting "_q_copyReadyRead()" 
triggered again after assigning the IODevice. If there's more than 32k of 
data, the function "nextDownstreamBlockSize()" still returns 32k. So one would 
expect this function to be called again until the whole copy is completed, but 
it's not.

This makes the cache useless because it could only be used on small files, 
which defeat its purpose.





More information about the Qt-interest-old mailing list