Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.2.0
-
None
-
Ubuntu 14.04, Qt 5.2.0
Description
If we're trying to access some HTTP content which has been cached, we usually get a single QNetworkReply::downloadProgress(), with both the params (bytesReceived and bytesTotal) as 0.
However, sometimes we get an extra QNetworkReply::downloadProgress() signal with bytesReceived as 0 and bytesTotal) as -1!
I think this is incorrect behaviour.
Ideally, both the parameters should reflect the actual content size. Even if this behaviour has been historically present, the -ve bytesTotal value seems clearly wrong.
I'm attaching a small application for testing this behaviour.
This was tested using Nginx. I used the following config section for sending back cache headers (put this in your /etc/nginx/sites-available/default):
location /cached { root /var/www/nginx-default; expires max; add_header Cache-Control public; }
Create a cached folder under your webserver's root dir (/var/www/nginx-default in this case) and place the file you want cached there. The pragma above works for requests coming to the cached dir only.
Attachments
Issue Links
- relates to
-
QTBUG-37450 Unitialized memory used in QElapsedTimer in QNetworkReplyImplPrivate::_q_copyReadyRead() NetworkReplyHttpImplPrivate::_q_cacheLoadReadyRead() , tst_qnetworkreply
- Reported