Closed Bug 379841 Opened 17 years ago Closed 17 years ago

nsIZipReader's last modified time ignores seconds

Categories

(Core :: Networking: JAR, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla1.9alpha5

People

(Reporter: mossop, Assigned: mossop)

Details

Attachments

(2 files, 2 obsolete files)

The ZIP specification allows for storing last modified times down to a 2 second resolution. Our zipreader however ignores the seconds on retrieval. What's more it's method of converting that time is somewhat inefficient in my book.
Attached patch patch rev 1 (obsolete) — Splinter Review
Uses direct time calculations including the seconds as well.
Attachment #263913 - Flags: review?(benjamin)
Component: General → Networking: JAR
QA Contact: general → networking.jar
Attachment #263913 - Flags: superreview+
Attachment #263913 - Flags: review?(cbiesinger)
Attachment #263913 - Flags: review?(benjamin)
Comment on attachment 263913 [details] [diff] [review]
patch rev 1

a unit test would be nice
Attachment #263913 - Flags: review?(cbiesinger) → review+
Attached patch unit test (obsolete) — Splinter Review
This is a unit test, confirmed that it fails without the patch in this bug and succeeds with it.
Attached file testcase for unit test
This is the zip file used as a testcase. Just contains an empty file.
Attachment #263999 - Flags: review?(cbiesinger)
Attachment #263999 - Flags: review?(cbiesinger) → review+
Attached patch patch rev 2Splinter Review
This is an updated patch that works correctly in all timezones.

We need to use NormalizeTime to fill out the PRExplodedTime so that the correct time zone details can be calculated.

We have to compare against a local time in the unit test because the zip time is held as a local time.
Attachment #263913 - Attachment is obsolete: true
Attachment #263999 - Attachment is obsolete: true
Attachment #264023 - Flags: review?(cbiesinger)
Attachment #264023 - Flags: review?(cbiesinger) → review+
Whiteboard: [checkin needed]
mozilla/modules/libjar/nsJAR.cpp                          1.128
mozilla/modules/libjar/test/unit/test_bug379841.js        1.1
mozilla/modules/libjar/test/unit/data/test_bug379841.zip  1.1
Status: NEW → RESOLVED
Closed: 17 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Target Milestone: --- → mozilla1.9alpha5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: