mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1091297 - http age calculation wrongly assumed monotonic time. r=hurley
This commit is contained in:
parent
d516ae610c
commit
9e6c9f6ced
@ -372,6 +372,11 @@ nsHttpResponseHead::ComputeCurrentAge(uint32_t now,
|
||||
|
||||
*result = 0;
|
||||
|
||||
if (requestTime > now) {
|
||||
// for calculation purposes lets not allow the request to happen in the future
|
||||
requestTime = now;
|
||||
}
|
||||
|
||||
if (NS_FAILED(GetDateValue(&dateValue))) {
|
||||
LOG(("nsHttpResponseHead::ComputeCurrentAge [this=%p] "
|
||||
"Date response header not set!\n", this));
|
||||
@ -388,8 +393,6 @@ nsHttpResponseHead::ComputeCurrentAge(uint32_t now,
|
||||
if (NS_SUCCEEDED(GetAgeValue(&ageValue)))
|
||||
*result = std::max(*result, ageValue);
|
||||
|
||||
MOZ_ASSERT(now >= requestTime, "bogus request time");
|
||||
|
||||
// Compute current age
|
||||
*result += (now - requestTime);
|
||||
return NS_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user