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
ed71ed59
Commit
ed71ed59
authored
Sep 21, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Sep 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Call FreeUrlCacheSpaceW when cache is full.
parent
b037bd7b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
6 deletions
+44
-6
internet.c
dlls/wininet/internet.c
+6
-2
internet.h
dlls/wininet/internet.h
+2
-2
urlcache.c
dlls/wininet/urlcache.c
+36
-2
No files found.
dlls/wininet/internet.c
View file @
ed71ed59
...
...
@@ -292,7 +292,11 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
if
(
g_dwTlsErrIndex
==
TLS_OUT_OF_INDEXES
)
return
FALSE
;
URLCacheContainers_CreateDefaults
();
if
(
!
init_urlcache
())
{
TlsFree
(
g_dwTlsErrIndex
);
return
FALSE
;
}
WININET_hModule
=
hinstDLL
;
break
;
...
...
@@ -310,7 +314,7 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
case
DLL_PROCESS_DETACH
:
collect_connections
(
COLLECT_CLEANUP
);
NETCON_unload
();
URLCacheContainers_DeleteAll
();
free_urlcache
();
if
(
g_dwTlsErrIndex
!=
TLS_OUT_OF_INDEXES
)
{
...
...
dlls/wininet/internet.h
View file @
ed71ed59
...
...
@@ -551,8 +551,8 @@ int sock_get_error(int) DECLSPEC_HIDDEN;
server_t
*
get_server
(
const
WCHAR
*
,
INTERNET_PORT
,
BOOL
);
extern
void
URLCacheContainers_CreateDefaults
(
void
)
DECLSPEC_HIDDEN
;
extern
void
URLCacheContainers_DeleteAll
(
void
)
DECLSPEC_HIDDEN
;
BOOL
init_urlcache
(
void
)
DECLSPEC_HIDDEN
;
void
free_urlcache
(
void
)
DECLSPEC_HIDDEN
;
#define MAX_REPLY_LEN 0x5B4
...
...
dlls/wininet/urlcache.c
View file @
ed71ed59
...
...
@@ -2326,6 +2326,22 @@ static BOOL DeleteUrlCacheEntryInternal(const URLCACHECONTAINER * pContainer,
return
TRUE
;
}
static
HANDLE
free_cache_running
;
static
DWORD
WINAPI
handle_full_cache_worker
(
void
*
param
)
{
FreeUrlCacheSpaceW
(
NULL
,
20
,
0
);
ReleaseSemaphore
(
free_cache_running
,
1
,
NULL
);
return
0
;
}
static
void
handle_full_cache
(
void
)
{
if
(
WaitForSingleObject
(
free_cache_running
,
0
)
==
WAIT_OBJECT_0
)
{
if
(
!
QueueUserWorkItem
(
handle_full_cache_worker
,
NULL
,
0
))
ReleaseSemaphore
(
free_cache_running
,
1
,
NULL
);
}
}
/***********************************************************************
* UnlockUrlCacheEntryFileA (WININET.@)
*
...
...
@@ -2712,7 +2728,6 @@ BOOL WINAPI CreateUrlCacheEntryW(
return
FALSE
;
}
/***********************************************************************
* CommitUrlCacheEntryInternal (Compensates for an MS bug)
*
...
...
@@ -2969,7 +2984,7 @@ static BOOL CommitUrlCacheEntryInternal(
pHeader
->
CacheUsage
.
QuadPart
+=
file_size
.
QuadPart
;
if
(
pHeader
->
CacheUsage
.
QuadPart
+
pHeader
->
ExemptUsage
.
QuadPart
>
pHeader
->
CacheLimit
.
QuadPart
)
FIXME
(
"file of size %s bytes fills cache
\n
"
,
wine_dbgstr_longlong
(
file_size
.
QuadPart
)
);
handle_full_cache
(
);
}
cleanup:
...
...
@@ -4114,3 +4129,22 @@ DWORD WINAPI RunOnceUrlCache(HWND hwnd, HINSTANCE hinst, LPSTR cmd, int cmdshow)
FIXME
(
"(%p, %p, %s, %d): stub
\n
"
,
hwnd
,
hinst
,
debugstr_a
(
cmd
),
cmdshow
);
return
0
;
}
BOOL
init_urlcache
(
void
)
{
free_cache_running
=
CreateSemaphoreW
(
NULL
,
1
,
1
,
NULL
);
if
(
!
free_cache_running
)
return
FALSE
;
URLCacheContainers_CreateDefaults
();
return
TRUE
;
}
void
free_urlcache
(
void
)
{
WaitForSingleObject
(
free_cache_running
,
INFINITE
);
ReleaseSemaphore
(
free_cache_running
,
1
,
NULL
);
CloseHandle
(
free_cache_running
);
URLCacheContainers_DeleteAll
();
}
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