Description[net] Subtract timestamps to determine if uploading file changed.
UploadFileElementReader relies on checking the modified time of files
being uploaded to determine if a sliced file was modified during upload.
Clients of the net stack (in particular Blink) currently pass around the
expected modified time in a manner which cause the timestamp to lose
precision (E.g. converting to and from a double time_t).
As a result the expected timestamp and the current timestamp as returned
by GetFileInfo() will not match exactly. Current code attempted to
compensate for this by converting both timestamps to (integer) time_t.
However, since the conversion rounds down, this check would only succeed
if the loss of precision of the expected timestamp also caused it to
round down. This is not always the case. (E.g. (epoch + 10.999999) will
become 10 when converted to time_t, but the expected timestamp may have
rounded up to (epoch + 11.0) in the meantime.)
This patch compares the timestamps by checking if the magnitude of the
difference is less than one second.
BUG=426465
CQ_EXTRA_TRYBOTS=tryserver.blink:linux_blink_rel,linux_blink_dbg,mac_blink_rel,win_blink_rel
R=mmenke
Committed: https://crrev.com/b77c8ffae588001875fb50ead987a147ca882bdb
Cr-Commit-Position: refs/heads/master@{#314397}
Reverted: https://crrev.com/7ccf4fab5d4473e431f1a289056033eea0b3dd43
Cr-Commit-Position: refs/heads/master@{#314451}
Committed: https://crrev.com/91430c35820e73f2e388a94e8f6260be79e480a8
Cr-Commit-Position: refs/heads/master@{#314634}
Patch Set 1 #
Total comments: 1
Patch Set 2 : Formatting #
Messages
Total messages: 15 (2 generated)
|