Bug 1091297 - http age calculation wrongly assumed monotonic time. r=hurley

This commit is contained in:
Patrick McManus 2014-10-31 15:45:08 -04:00
parent d516ae610c
commit 9e6c9f6ced

View File

@ -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;