Review Request 126857: kio_http: fix porting bugs which broke caching.

David Faure faure at kde.org
Wed Jan 27 07:41:02 UTC 2016


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/126857/
-----------------------------------------------------------

(Updated Jan. 27, 2016, 8:41 a.m.)


Status
------

This change has been marked as submitted.


Review request for KDE Frameworks.


Changes
-------

Submitted with commit ead19e986357bcecb334706732bf7aba339d0880 by David Faure to branch master.


Repository: kio


Description
-------

CacheLocation was used instead of GenericCacheLocation, so the appname was inserted
into it which would have broken sharing the cache between apps. But anyway no
caching happened at all because the subdir of the cache wasn't being created
(missing mkpath).

Repairing the use of the cache brought up an assert just after writing, because
the size of cache entries wasn't the expected size; this was due to mtime -> QDateTime
porting. Repaired by converting to "seconds since epoch", like kdelibs4 was doing.
Milliseconds don't seem to be part of the RFCs for HTTP dates anyway.

Change-Id: Ie13c9923f02429a8b1893ba9f66f733673d5ddad


Diffs
-----

  src/core/kprotocolmanager.cpp bd42c9e1bb6379238a46c6483f12bcbc9ccc0e6d 
  src/core/sessiondata.cpp d21ab21581da3f5bf3dc31c012d0056f50af3423 
  src/ioslaves/http/http.cpp 76da711cbb3eee9ba801a6e8117d78aaee467626 
  src/ioslaves/http/http_cache_cleaner.cpp c272c6ecc75ef07418cdfe4a17af4b0475d6ff0a 

Diff: https://git.reviewboard.kde.org/r/126857/diff/


Testing
-------

I spotted the error below in kio_http's output
HTTPProtocol::cacheFileOpenWrite: Could not open file for writing: "" due to error 5

(First fix was to fix the debug output not to show an empty filename on error)

Now kio_http says lots of good things like "readBody: reading data from cache..."


Thanks,

David Faure

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20160127/ab294f5a/attachment.html>


More information about the Kde-frameworks-devel mailing list