зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1091297 - http age calculation wrongly assumed monotonic time. r=hurley
This commit is contained in:
Родитель
ae83260be8
Коммит
6a0b4d6eed
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче