Commit bbbc6d11 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

wininet: Don't create cache file if it's forbidden.

parent 6874bf3c
......@@ -2261,15 +2261,35 @@ static void commit_cache_entry(http_request_t *req)
static void create_cache_entry(http_request_t *req)
{
static const WCHAR no_cacheW[] = {'n','o','-','c','a','c','h','e',0};
static const WCHAR no_storeW[] = {'n','o','-','s','t','o','r','e',0};
WCHAR url[INTERNET_MAX_URL_LENGTH];
WCHAR file_name[MAX_PATH+1];
BOOL b;
BOOL b = TRUE;
/* FIXME: We should free previous cache file earlier */
heap_free(req->cacheFile);
CloseHandle(req->hCacheFile);
req->hCacheFile = NULL;
if(req->hdr.dwFlags & INTERNET_FLAG_NO_CACHE_WRITE)
b = FALSE;
if(b) {
int header_idx = HTTP_GetCustomHeaderIndex(req, szCache_Control, 0, FALSE);
if(header_idx!=-1 && (!strcmpiW(req->custHeaders[header_idx].lpszValue, no_cacheW)
|| !strcmpiW(req->custHeaders[header_idx].lpszValue, no_storeW)))
b = FALSE;
}
if(!b) {
if(!(req->hdr.dwFlags & INTERNET_FLAG_NEED_FILE))
return;
FIXME("INTERNET_FLAG_NEED_FILE is not supported correctly\n");
}
b = HTTP_GetRequestURL(req, url);
if(!b) {
WARN("Could not get URL\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment