forked from Mirrors/wine-wine
cryptnet: Delete existing cache entries when out of date.
parent
778757ba74
commit
2a53eb7087
|
@ -740,11 +740,16 @@ static void CRYPT_CacheURL(LPCWSTR pszURL, const CRYPT_BLOB_ARRAY *pObject,
|
||||||
if (ret)
|
if (ret)
|
||||||
lstrcpyW(cacheFileName, info->lpszLocalFileName);
|
lstrcpyW(cacheFileName, info->lpszLocalFileName);
|
||||||
/* Check if the existing cache entry is up to date. If it isn't,
|
/* Check if the existing cache entry is up to date. If it isn't,
|
||||||
* overwite it with the new value.
|
* remove the existing cache entry, and create a new one with the
|
||||||
|
* new value.
|
||||||
*/
|
*/
|
||||||
GetSystemTimeAsFileTime(&ft);
|
GetSystemTimeAsFileTime(&ft);
|
||||||
if (CompareFileTime(&info->ExpireTime, &ft) < 0)
|
if (CompareFileTime(&info->ExpireTime, &ft) < 0)
|
||||||
|
{
|
||||||
create = TRUE;
|
create = TRUE;
|
||||||
|
DeleteUrlCacheEntryW(pszURL);
|
||||||
|
DeleteFileW(cacheFileName);
|
||||||
|
}
|
||||||
CryptMemFree(info);
|
CryptMemFree(info);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue