When data for a url is received as multiple parts, the cache file for the url is truncated when opened for writing, and will only contain the last part of data received.
Created attachment 231688 [details] Patch
Comment on attachment 231688 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=231688&action=review r-: Please adjust a few functions for early return! :-) > Source/WebCore/platform/network/curl/CurlCacheEntry.cpp:365 > + if (m_contentFile == invalidPlatformFileHandle) { We prefer this as an early return: "if (m_contentFile != invalidPlatformFileHandle) \r return true;" > Source/WebCore/platform/network/curl/CurlCacheEntry.cpp:366 > + m_contentFile = openFile(m_contentFilename, OpenForWrite); I was very surprised to see that we don't have an "OpenForWrite" style that does not concatenate the file! > Source/WebCore/platform/network/curl/CurlCacheEntry.cpp:367 > + if (!isHandleValid(m_contentFile)) { Again, we prefer to exit early if possible in tests like this. > Source/WebCore/platform/network/curl/CurlCacheEntry.cpp:377 > + if (m_contentFile != invalidPlatformFileHandle) { Early return please.
Created attachment 231694 [details] Patch
(In reply to comment #2) > (From update of attachment 231688 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=231688&action=review > Thanks for reviewing :) Updated patch. > > I was very surprised to see that we don't have an "OpenForWrite" style that does not concatenate the file! Mee to :)
Comment on attachment 231694 [details] Patch Thanks for revising! r=me.
Comment on attachment 231694 [details] Patch Clearing flags on attachment: 231694 Committed r169115: <http://trac.webkit.org/changeset/169115>
All reviewed patches have been landed. Closing bug.