Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
6935b7c7
Commit
6935b7c7
authored
Sep 18, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Sep 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Unlock urlcache entries that were locked for over a day.
parent
359ed338
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
6 deletions
+37
-6
urlcache.c
dlls/wininet/urlcache.c
+37
-6
No files found.
dlls/wininet/urlcache.c
View file @
6935b7c7
...
...
@@ -1553,6 +1553,38 @@ static BOOL URLCache_DeleteCacheDirectory(LPCWSTR lpszPath)
}
/***********************************************************************
* URLCache_IsLocked (Internal)
*
* Checks if entry is locked. Unlocks it if possible.
*/
static
BOOL
URLCache_IsLocked
(
struct
_HASH_ENTRY
*
hash_entry
,
URL_CACHEFILE_ENTRY
*
url_entry
)
{
FILETIME
cur_time
;
ULARGE_INTEGER
acc_time
,
time
;
if
((
hash_entry
->
dwHashKey
&
((
1
<<
HASHTABLE_FLAG_BITS
)
-
1
))
!=
HASHTABLE_LOCK
)
return
FALSE
;
GetSystemTimeAsFileTime
(
&
cur_time
);
time
.
u
.
LowPart
=
cur_time
.
dwLowDateTime
;
time
.
u
.
HighPart
=
cur_time
.
dwHighDateTime
;
acc_time
.
u
.
LowPart
=
url_entry
->
LastAccessTime
.
dwLowDateTime
;
acc_time
.
u
.
HighPart
=
url_entry
->
LastAccessTime
.
dwHighDateTime
;
time
.
QuadPart
-=
acc_time
.
QuadPart
;
/* check if entry was locked for at least a day */
if
(
time
.
QuadPart
>
(
ULONGLONG
)
24
*
60
*
60
*
10000000
)
{
URLCache_HashEntrySetFlags
(
hash_entry
,
HASHTABLE_URL
);
url_entry
->
dwUseCount
=
0
;
return
FALSE
;
}
return
TRUE
;
}
/***********************************************************************
* FreeUrlCacheSpaceW (WININET.@)
*
* Frees up some cache.
...
...
@@ -2193,9 +2225,8 @@ static BOOL DeleteUrlCacheEntryInternal(const URLCACHECONTAINER * pContainer,
}
pUrlEntry
=
(
URL_CACHEFILE_ENTRY
*
)
pEntry
;
if
((
pHashEntry
->
dwHashKey
&
((
1
<<
HASHTABLE_FLAG_BITS
)
-
1
))
==
HASHTABLE_LOCK
)
if
(
URLCache_IsLocked
(
pHashEntry
,
pUrlEntry
)
)
{
/* FIXME: implement timeout object unlocking */
TRACE
(
"Trying to delete locked entry
\n
"
);
pUrlEntry
->
CacheEntryType
|=
PENDING_DELETE_CACHE_ENTRY
;
SetLastError
(
ERROR_SHARING_VIOLATION
);
...
...
@@ -2736,11 +2767,11 @@ static BOOL CommitUrlCacheEntryInternal(
if
(
URLCache_FindHash
(
pHeader
,
lpszUrlNameA
,
&
pHashEntry
))
{
if
((
pHashEntry
->
dwHashKey
&
((
1
<<
HASHTABLE_FLAG_BITS
)
-
1
))
==
HASHTABLE_LOCK
)
URL_CACHEFILE_ENTRY
*
pUrlEntry
=
(
URL_CACHEFILE_ENTRY
*
)((
LPBYTE
)
pHeader
+
pHashEntry
->
dwOffsetEntry
);
if
(
URLCache_IsLocked
(
pHashEntry
,
pUrlEntry
))
{
/* FIXME: implement timeout object unlocking */
FIXME
(
"Trying to overwrite locked entry
\n
"
);
SetLastError
(
ERROR_SHARING_VIOLATION
);
TRACE
(
"Trying to overwrite locked entry
\n
"
);
error
=
ERROR_SHARING_VIOLATION
;
goto
cleanup
;
}
...
...
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