From ab16c75c48a79786a7adeb4dd93dc3135faaeb18 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Thu, 3 Mar 2011 10:54:07 -0800 Subject: [PATCH] wininet: Default to 10 minutes expiration for cache entries. --- dlls/wininet/http.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 85484bf43c8..3254a2514fa 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -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; } }