wininet: Default to 10 minutes expiration for cache entries.

This commit is contained in:
Juan Lang 2011-03-03 10:54:07 -08:00 committed by Alexandre Julliard
parent 0b5ea6f970
commit ab16c75c48
1 changed files with 14 additions and 0 deletions

View File

@ -3757,6 +3757,7 @@ static BOOL HTTP_ParseDate(LPCWSTR value, FILETIME *ft)
static void HTTP_ProcessExpires(http_request_t *request)
{
BOOL expirationFound = FALSE;
int headerIndex;
headerIndex = HTTP_GetCustomHeaderIndex(request, szExpires, 0, FALSE);
@ -3766,7 +3767,20 @@ static void HTTP_ProcessExpires(http_request_t *request)
FILETIME ft;
if (HTTP_ParseDate(expiresHeader->lpszValue, &ft))
{
expirationFound = TRUE;
request->expires = ft;
}
}
if (!expirationFound)
{
ULARGE_INTEGER ft;
/* With no known age, default to 10 minutes until expiration. */
GetSystemTimeAsFileTime((FILETIME *)&ft);
ft.QuadPart += 10 * 60 * 10000000;
request->expires.dwLowDateTime = ft.u.LowPart;
request->expires.dwHighDateTime = ft.u.HighPart;
}
}