Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
45f260e3
Commit
45f260e3
authored
Oct 23, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Oct 24, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cryptnet: Get cache entry expire time from HTTP expires header.
parent
6c5f759d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
cryptnet_main.c
dlls/cryptnet/cryptnet_main.c
+17
-4
No files found.
dlls/cryptnet/cryptnet_main.c
View file @
45f260e3
...
...
@@ -396,7 +396,6 @@ static BOOL CRYPT_GetObjectFromFile(HANDLE hFile, PCRYPT_BLOB_ARRAY pObject)
}
/* FIXME: should make wininet cache all downloads instead */
/* FIXME: how do I know the cached object is up to date? */
static
BOOL
CRYPT_GetObjectFromCache
(
LPCWSTR
pszURL
,
PCRYPT_BLOB_ARRAY
pObject
,
PCRYPT_RETRIEVE_AUX_INFO
pAuxInfo
)
{
...
...
@@ -610,7 +609,7 @@ static BOOL CRYPT_DownloadObject(DWORD dwRetrievalFlags, HINTERNET hHttp,
}
static
void
CRYPT_CacheURL
(
LPCWSTR
pszURL
,
PCRYPT_BLOB_ARRAY
pObject
,
DWORD
dwRetrievalFlags
)
DWORD
dwRetrievalFlags
,
FILETIME
expires
)
{
WCHAR
cacheFileName
[
MAX_PATH
];
...
...
@@ -633,7 +632,7 @@ static void CRYPT_CacheURL(LPCWSTR pszURL, PCRYPT_BLOB_ARRAY pObject,
WriteFile
(
hCacheFile
,
pObject
->
rgBlob
[
0
].
pbData
,
pObject
->
rgBlob
[
0
].
cbData
,
&
bytesWritten
,
NULL
);
CloseHandle
(
hCacheFile
);
CommitUrlCacheEntryW
(
pszURL
,
cacheFileName
,
ft
,
ft
,
entryType
,
CommitUrlCacheEntryW
(
pszURL
,
cacheFileName
,
expires
,
ft
,
entryType
,
NULL
,
0
,
NULL
,
NULL
);
}
}
...
...
@@ -820,7 +819,21 @@ static BOOL WINAPI HTTP_RetrieveEncodedObjectW(LPCWSTR pszURL,
ret
=
CRYPT_DownloadObject
(
dwRetrievalFlags
,
hHttp
,
context
,
pObject
,
pAuxInfo
);
if
(
ret
&&
!
(
dwRetrievalFlags
&
CRYPT_DONT_CACHE_RESULT
))
CRYPT_CacheURL
(
pszURL
,
pObject
,
dwRetrievalFlags
);
{
SYSTEMTIME
st
;
DWORD
len
=
sizeof
(
st
);
if
(
HttpQueryInfoW
(
hHttp
,
HTTP_QUERY_EXPIRES
|
HTTP_QUERY_FLAG_SYSTEMTIME
,
&
st
,
&
len
,
NULL
))
{
FILETIME
ft
;
SystemTimeToFileTime
(
&
st
,
&
ft
);
CRYPT_CacheURL
(
pszURL
,
pObject
,
dwRetrievalFlags
,
ft
);
}
}
InternetCloseHandle
(
hHttp
);
}
InternetCloseHandle
(
hHost
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment