Closed
Bug 994574
Opened 10 years ago
Closed 10 years ago
HTTP cache v2: CacheFileMetadata::ParseMetadata() fails to parse any entry
Categories
(Core :: Networking: Cache, defect)
Tracking
()
RESOLVED
FIXED
mozilla31
People
(Reporter: michal, Assigned: michal)
References
Details
Attachments
(1 file)
3.52 KB,
patch
|
mayhemer
:
review+
|
Details | Diff | Splinter Review |
This is a regression caused by bug 988186. All members of CacheFileMetadataHeader are now stored in network order but we use keySize in CacheFileMetadata::ParseMetadata() without converting it back to host order.
Attachment #8404572 -
Flags: review?(honzab.moz)
Comment 1•10 years ago
|
||
Comment on attachment 8404572 [details] [diff] [review] fix Review of attachment 8404572 [details] [diff] [review]: ----------------------------------------------------------------- locally tested r=honzab sad we don't have a persistence tests to catch this, need to think of some. ::: netwerk/cache2/CacheFileMetadata.cpp @@ +736,5 @@ > + > + if (mMetaHdr.mVersion != kCacheEntryVersion) { > + LOG(("CacheFileMetadata::ParseMetadata() - Not a version we understand to. " > + "[version=0x%x, this=%p]", mMetaHdr.mVersion, this)); > + return NS_ERROR_UNEXPECTED; is UNEXPECTED really the best error here? (no idea for a better one tho)
Attachment #8404572 -
Flags: review?(honzab.moz) → review+
Assignee | ||
Comment 2•10 years ago
|
||
(In reply to Honza Bambas (:mayhemer) from comment #1) > ::: netwerk/cache2/CacheFileMetadata.cpp > @@ +736,5 @@ > > + > > + if (mMetaHdr.mVersion != kCacheEntryVersion) { > > + LOG(("CacheFileMetadata::ParseMetadata() - Not a version we understand to. " > > + "[version=0x%x, this=%p]", mMetaHdr.mVersion, this)); > > + return NS_ERROR_UNEXPECTED; > > is UNEXPECTED really the best error here? (no idea for a better one tho) I'm curious about your reply because you chose this error in bug 941698 ;) Seriously, I thought about this while doing review of 941698 and I think UNEXPECTED is OK. Error NS_ERROR_FILE_CORRUPTED is returned elsewhere in CacheFileMetadata::ParseMetadata() but it is IMO not appropriate in this case.
Assignee | ||
Comment 3•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/f19a8c881401
Comment 4•10 years ago
|
||
(In reply to Michal Novotny (:michal) from comment #2) > I'm curious about your reply because you chose this error in bug 941698 ;) > Seriously, I thought about this while doing review of 941698 and I think > UNEXPECTED is OK. Error NS_ERROR_FILE_CORRUPTED is returned elsewhere in > CacheFileMetadata::ParseMetadata() but it is IMO not appropriate in this > case. You got me :D OK, yeah, I probably was not able to find a better one that time too. And just forgot about that dilemma...
Comment 5•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/f19a8c881401
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
Comment 6•10 years ago
|
||
Honza, is this something you may want to write a test for (I would not want you to be sad!) I can also ask Henrik if it's something he can figure out how to cover in the QA testsuite. Thanks!
Flags: needinfo?(honzab.moz)
Flags: in-testsuite?
Flags: in-qa-testsuite?
Comment 7•10 years ago
|
||
We have some plans with Michal to add test for our persisting format. It's a bit tricky and will be covered in a different bug.
Flags: needinfo?(honzab.moz)
Comment 8•10 years ago
|
||
Honza, when will this happen? I don't think it's worth our time to create a mozmill test if an in-tree test comes up in a bit.
Flags: needinfo?(honzab.moz)
Comment 9•10 years ago
|
||
Delegating to Michal.
Flags: needinfo?(honzab.moz) → needinfo?(michal.novotny)
Assignee | ||
Comment 10•10 years ago
|
||
I'll try to come up with some test for this in bug 994606 in a reasonable time...
Flags: needinfo?(michal.novotny)
Comment 11•10 years ago
|
||
Thank you Michal. I will remove in-qa-testsuite to get it out of our todo list.
Flags: in-qa-testsuite?
Updated•6 years ago
|
Flags: in-testsuite?
You need to log in
before you can comment on or make changes to this bug.
Description
•