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
af61cbdd
Commit
af61cbdd
authored
Oct 22, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Oct 23, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Use URLCache_FindHash rather than URLCache_FindEntryInHash.
parent
d21c5044
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
30 deletions
+23
-30
urlcache.c
dlls/wininet/urlcache.c
+23
-30
No files found.
dlls/wininet/urlcache.c
View file @
af61cbdd
...
@@ -1164,28 +1164,6 @@ static BOOL URLCache_FindHash(LPCURLCACHE_HEADER pHeader, LPCSTR lpszUrl, struct
...
@@ -1164,28 +1164,6 @@ static BOOL URLCache_FindHash(LPCURLCACHE_HEADER pHeader, LPCSTR lpszUrl, struct
}
}
/***********************************************************************
/***********************************************************************
* URLCache_FindEntryInHash (Internal)
*
* Searches all the hash tables in the index for the given URL and
* returns the entry, if it was found, in ppEntry
*
* RETURNS
* TRUE if the entry was found
* FALSE if the entry could not be found
*
*/
static
BOOL
URLCache_FindEntryInHash
(
LPCURLCACHE_HEADER
pHeader
,
LPCSTR
lpszUrl
,
CACHEFILE_ENTRY
**
ppEntry
)
{
struct
_HASH_ENTRY
*
pHashEntry
;
if
(
URLCache_FindHash
(
pHeader
,
lpszUrl
,
&
pHashEntry
))
{
*
ppEntry
=
(
CACHEFILE_ENTRY
*
)((
LPBYTE
)
pHeader
+
pHashEntry
->
dwOffsetEntry
);
return
TRUE
;
}
return
FALSE
;
}
/***********************************************************************
* URLCache_FindEntryInHashW (Internal)
* URLCache_FindEntryInHashW (Internal)
*
*
* Searches all the hash tables in the index for the given URL and
* Searches all the hash tables in the index for the given URL and
...
@@ -1398,6 +1376,7 @@ BOOL WINAPI GetUrlCacheEntryInfoA(
...
@@ -1398,6 +1376,7 @@ BOOL WINAPI GetUrlCacheEntryInfoA(
)
)
{
{
LPURLCACHE_HEADER
pHeader
;
LPURLCACHE_HEADER
pHeader
;
struct
_HASH_ENTRY
*
pHashEntry
;
CACHEFILE_ENTRY
*
pEntry
;
CACHEFILE_ENTRY
*
pEntry
;
URL_CACHEFILE_ENTRY
*
pUrlEntry
;
URL_CACHEFILE_ENTRY
*
pUrlEntry
;
URLCACHECONTAINER
*
pContainer
;
URLCACHECONTAINER
*
pContainer
;
...
@@ -1413,7 +1392,7 @@ BOOL WINAPI GetUrlCacheEntryInfoA(
...
@@ -1413,7 +1392,7 @@ BOOL WINAPI GetUrlCacheEntryInfoA(
if
(
!
(
pHeader
=
URLCacheContainer_LockIndex
(
pContainer
)))
if
(
!
(
pHeader
=
URLCacheContainer_LockIndex
(
pContainer
)))
return
FALSE
;
return
FALSE
;
if
(
!
URLCache_Find
EntryInHash
(
pHeader
,
lpszUrlName
,
&
p
Entry
))
if
(
!
URLCache_Find
Hash
(
pHeader
,
lpszUrlName
,
&
pHash
Entry
))
{
{
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
WARN
(
"entry %s not found!
\n
"
,
debugstr_a
(
lpszUrlName
));
WARN
(
"entry %s not found!
\n
"
,
debugstr_a
(
lpszUrlName
));
...
@@ -1421,6 +1400,7 @@ BOOL WINAPI GetUrlCacheEntryInfoA(
...
@@ -1421,6 +1400,7 @@ BOOL WINAPI GetUrlCacheEntryInfoA(
return
FALSE
;
return
FALSE
;
}
}
pEntry
=
(
CACHEFILE_ENTRY
*
)((
LPBYTE
)
pHeader
+
pHashEntry
->
dwOffsetEntry
);
if
(
pEntry
->
dwSignature
!=
URL_SIGNATURE
)
if
(
pEntry
->
dwSignature
!=
URL_SIGNATURE
)
{
{
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
...
@@ -1558,6 +1538,7 @@ BOOL WINAPI SetUrlCacheEntryInfoA(
...
@@ -1558,6 +1538,7 @@ BOOL WINAPI SetUrlCacheEntryInfoA(
DWORD
dwFieldControl
)
DWORD
dwFieldControl
)
{
{
LPURLCACHE_HEADER
pHeader
;
LPURLCACHE_HEADER
pHeader
;
struct
_HASH_ENTRY
*
pHashEntry
;
CACHEFILE_ENTRY
*
pEntry
;
CACHEFILE_ENTRY
*
pEntry
;
URLCACHECONTAINER
*
pContainer
;
URLCACHECONTAINER
*
pContainer
;
...
@@ -1572,7 +1553,7 @@ BOOL WINAPI SetUrlCacheEntryInfoA(
...
@@ -1572,7 +1553,7 @@ BOOL WINAPI SetUrlCacheEntryInfoA(
if
(
!
(
pHeader
=
URLCacheContainer_LockIndex
(
pContainer
)))
if
(
!
(
pHeader
=
URLCacheContainer_LockIndex
(
pContainer
)))
return
FALSE
;
return
FALSE
;
if
(
!
URLCache_Find
EntryInHash
(
pHeader
,
lpszUrlName
,
&
p
Entry
))
if
(
!
URLCache_Find
Hash
(
pHeader
,
lpszUrlName
,
&
pHash
Entry
))
{
{
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
WARN
(
"entry %s not found!
\n
"
,
debugstr_a
(
lpszUrlName
));
WARN
(
"entry %s not found!
\n
"
,
debugstr_a
(
lpszUrlName
));
...
@@ -1580,6 +1561,7 @@ BOOL WINAPI SetUrlCacheEntryInfoA(
...
@@ -1580,6 +1561,7 @@ BOOL WINAPI SetUrlCacheEntryInfoA(
return
FALSE
;
return
FALSE
;
}
}
pEntry
=
(
CACHEFILE_ENTRY
*
)((
LPBYTE
)
pHeader
+
pHashEntry
->
dwOffsetEntry
);
if
(
pEntry
->
dwSignature
!=
URL_SIGNATURE
)
if
(
pEntry
->
dwSignature
!=
URL_SIGNATURE
)
{
{
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
...
@@ -1656,6 +1638,7 @@ BOOL WINAPI RetrieveUrlCacheEntryFileA(
...
@@ -1656,6 +1638,7 @@ BOOL WINAPI RetrieveUrlCacheEntryFileA(
)
)
{
{
LPURLCACHE_HEADER
pHeader
;
LPURLCACHE_HEADER
pHeader
;
struct
_HASH_ENTRY
*
pHashEntry
;
CACHEFILE_ENTRY
*
pEntry
;
CACHEFILE_ENTRY
*
pEntry
;
URL_CACHEFILE_ENTRY
*
pUrlEntry
;
URL_CACHEFILE_ENTRY
*
pUrlEntry
;
URLCACHECONTAINER
*
pContainer
;
URLCACHECONTAINER
*
pContainer
;
...
@@ -1675,7 +1658,7 @@ BOOL WINAPI RetrieveUrlCacheEntryFileA(
...
@@ -1675,7 +1658,7 @@ BOOL WINAPI RetrieveUrlCacheEntryFileA(
if
(
!
(
pHeader
=
URLCacheContainer_LockIndex
(
pContainer
)))
if
(
!
(
pHeader
=
URLCacheContainer_LockIndex
(
pContainer
)))
return
FALSE
;
return
FALSE
;
if
(
!
URLCache_Find
EntryInHash
(
pHeader
,
lpszUrlName
,
&
p
Entry
))
if
(
!
URLCache_Find
Hash
(
pHeader
,
lpszUrlName
,
&
pHash
Entry
))
{
{
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
TRACE
(
"entry %s not found!
\n
"
,
lpszUrlName
);
TRACE
(
"entry %s not found!
\n
"
,
lpszUrlName
);
...
@@ -1683,6 +1666,7 @@ BOOL WINAPI RetrieveUrlCacheEntryFileA(
...
@@ -1683,6 +1666,7 @@ BOOL WINAPI RetrieveUrlCacheEntryFileA(
return
FALSE
;
return
FALSE
;
}
}
pEntry
=
(
CACHEFILE_ENTRY
*
)((
LPBYTE
)
pHeader
+
pHashEntry
->
dwOffsetEntry
);
if
(
pEntry
->
dwSignature
!=
URL_SIGNATURE
)
if
(
pEntry
->
dwSignature
!=
URL_SIGNATURE
)
{
{
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
...
@@ -1741,6 +1725,7 @@ BOOL WINAPI UnlockUrlCacheEntryFileA(
...
@@ -1741,6 +1725,7 @@ BOOL WINAPI UnlockUrlCacheEntryFileA(
)
)
{
{
LPURLCACHE_HEADER
pHeader
;
LPURLCACHE_HEADER
pHeader
;
struct
_HASH_ENTRY
*
pHashEntry
;
CACHEFILE_ENTRY
*
pEntry
;
CACHEFILE_ENTRY
*
pEntry
;
URL_CACHEFILE_ENTRY
*
pUrlEntry
;
URL_CACHEFILE_ENTRY
*
pUrlEntry
;
URLCACHECONTAINER
*
pContainer
;
URLCACHECONTAINER
*
pContainer
;
...
@@ -1763,7 +1748,7 @@ BOOL WINAPI UnlockUrlCacheEntryFileA(
...
@@ -1763,7 +1748,7 @@ BOOL WINAPI UnlockUrlCacheEntryFileA(
if
(
!
(
pHeader
=
URLCacheContainer_LockIndex
(
pContainer
)))
if
(
!
(
pHeader
=
URLCacheContainer_LockIndex
(
pContainer
)))
return
FALSE
;
return
FALSE
;
if
(
!
URLCache_Find
EntryInHash
(
pHeader
,
lpszUrlName
,
&
p
Entry
))
if
(
!
URLCache_Find
Hash
(
pHeader
,
lpszUrlName
,
&
pHash
Entry
))
{
{
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
TRACE
(
"entry %s not found!
\n
"
,
lpszUrlName
);
TRACE
(
"entry %s not found!
\n
"
,
lpszUrlName
);
...
@@ -1771,6 +1756,7 @@ BOOL WINAPI UnlockUrlCacheEntryFileA(
...
@@ -1771,6 +1756,7 @@ BOOL WINAPI UnlockUrlCacheEntryFileA(
return
FALSE
;
return
FALSE
;
}
}
pEntry
=
(
CACHEFILE_ENTRY
*
)((
LPBYTE
)
pHeader
+
pHashEntry
->
dwOffsetEntry
);
if
(
pEntry
->
dwSignature
!=
URL_SIGNATURE
)
if
(
pEntry
->
dwSignature
!=
URL_SIGNATURE
)
{
{
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
...
@@ -2021,6 +2007,7 @@ static BOOL WINAPI CommitUrlCacheEntryInternal(
...
@@ -2021,6 +2007,7 @@ static BOOL WINAPI CommitUrlCacheEntryInternal(
{
{
URLCACHECONTAINER
*
pContainer
;
URLCACHECONTAINER
*
pContainer
;
LPURLCACHE_HEADER
pHeader
;
LPURLCACHE_HEADER
pHeader
;
struct
_HASH_ENTRY
*
pHashEntry
;
CACHEFILE_ENTRY
*
pEntry
;
CACHEFILE_ENTRY
*
pEntry
;
URL_CACHEFILE_ENTRY
*
pUrlEntry
;
URL_CACHEFILE_ENTRY
*
pUrlEntry
;
DWORD
dwBytesNeeded
=
DWORD_ALIGN
(
sizeof
(
*
pUrlEntry
));
DWORD
dwBytesNeeded
=
DWORD_ALIGN
(
sizeof
(
*
pUrlEntry
));
...
@@ -2079,7 +2066,7 @@ static BOOL WINAPI CommitUrlCacheEntryInternal(
...
@@ -2079,7 +2066,7 @@ static BOOL WINAPI CommitUrlCacheEntryInternal(
WideCharToMultiByte
(
CP_ACP
,
0
,
lpszUrlName
,
-
1
,
achUrl
,
-
1
,
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
lpszUrlName
,
-
1
,
achUrl
,
-
1
,
NULL
,
NULL
);
if
(
URLCache_Find
EntryInHash
(
pHeader
,
achUrl
,
&
p
Entry
))
if
(
URLCache_Find
Hash
(
pHeader
,
achUrl
,
&
pHash
Entry
))
{
{
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
FIXME
(
"entry already in cache - don't know what to do!
\n
"
);
FIXME
(
"entry already in cache - don't know what to do!
\n
"
);
...
@@ -2492,6 +2479,7 @@ BOOL WINAPI DeleteUrlCacheEntryA(LPCSTR lpszUrlName)
...
@@ -2492,6 +2479,7 @@ BOOL WINAPI DeleteUrlCacheEntryA(LPCSTR lpszUrlName)
{
{
URLCACHECONTAINER
*
pContainer
;
URLCACHECONTAINER
*
pContainer
;
LPURLCACHE_HEADER
pHeader
;
LPURLCACHE_HEADER
pHeader
;
struct
_HASH_ENTRY
*
pHashEntry
;
CACHEFILE_ENTRY
*
pEntry
;
CACHEFILE_ENTRY
*
pEntry
;
TRACE
(
"(%s)
\n
"
,
debugstr_a
(
lpszUrlName
));
TRACE
(
"(%s)
\n
"
,
debugstr_a
(
lpszUrlName
));
...
@@ -2505,7 +2493,7 @@ BOOL WINAPI DeleteUrlCacheEntryA(LPCSTR lpszUrlName)
...
@@ -2505,7 +2493,7 @@ BOOL WINAPI DeleteUrlCacheEntryA(LPCSTR lpszUrlName)
if
(
!
(
pHeader
=
URLCacheContainer_LockIndex
(
pContainer
)))
if
(
!
(
pHeader
=
URLCacheContainer_LockIndex
(
pContainer
)))
return
FALSE
;
return
FALSE
;
if
(
!
URLCache_Find
EntryInHash
(
pHeader
,
lpszUrlName
,
&
p
Entry
))
if
(
!
URLCache_Find
Hash
(
pHeader
,
lpszUrlName
,
&
pHash
Entry
))
{
{
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
TRACE
(
"entry %s not found!
\n
"
,
lpszUrlName
);
TRACE
(
"entry %s not found!
\n
"
,
lpszUrlName
);
...
@@ -2513,6 +2501,7 @@ BOOL WINAPI DeleteUrlCacheEntryA(LPCSTR lpszUrlName)
...
@@ -2513,6 +2501,7 @@ BOOL WINAPI DeleteUrlCacheEntryA(LPCSTR lpszUrlName)
return
FALSE
;
return
FALSE
;
}
}
pEntry
=
(
CACHEFILE_ENTRY
*
)((
LPBYTE
)
pHeader
+
pHashEntry
->
dwOffsetEntry
);
URLCache_DeleteEntry
(
pHeader
,
pEntry
);
URLCache_DeleteEntry
(
pHeader
,
pEntry
);
URLCache_DeleteEntryFromHash
(
pHeader
,
lpszUrlName
);
URLCache_DeleteEntryFromHash
(
pHeader
,
lpszUrlName
);
...
@@ -2530,6 +2519,7 @@ BOOL WINAPI DeleteUrlCacheEntryW(LPCWSTR lpszUrlName)
...
@@ -2530,6 +2519,7 @@ BOOL WINAPI DeleteUrlCacheEntryW(LPCWSTR lpszUrlName)
{
{
URLCACHECONTAINER
*
pContainer
;
URLCACHECONTAINER
*
pContainer
;
LPURLCACHE_HEADER
pHeader
;
LPURLCACHE_HEADER
pHeader
;
struct
_HASH_ENTRY
*
pHashEntry
;
CACHEFILE_ENTRY
*
pEntry
;
CACHEFILE_ENTRY
*
pEntry
;
LPSTR
urlA
;
LPSTR
urlA
;
int
url_len
;
int
url_len
;
...
@@ -2561,7 +2551,7 @@ BOOL WINAPI DeleteUrlCacheEntryW(LPCWSTR lpszUrlName)
...
@@ -2561,7 +2551,7 @@ BOOL WINAPI DeleteUrlCacheEntryW(LPCWSTR lpszUrlName)
return
FALSE
;
return
FALSE
;
}
}
if
(
!
URLCache_Find
EntryInHash
(
pHeader
,
urlA
,
&
p
Entry
))
if
(
!
URLCache_Find
Hash
(
pHeader
,
urlA
,
&
pHash
Entry
))
{
{
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
TRACE
(
"entry %s not found!
\n
"
,
debugstr_a
(
urlA
));
TRACE
(
"entry %s not found!
\n
"
,
debugstr_a
(
urlA
));
...
@@ -2570,6 +2560,7 @@ BOOL WINAPI DeleteUrlCacheEntryW(LPCWSTR lpszUrlName)
...
@@ -2570,6 +2560,7 @@ BOOL WINAPI DeleteUrlCacheEntryW(LPCWSTR lpszUrlName)
return
FALSE
;
return
FALSE
;
}
}
pEntry
=
(
CACHEFILE_ENTRY
*
)((
LPBYTE
)
pHeader
+
pHashEntry
->
dwOffsetEntry
);
URLCache_DeleteEntry
(
pHeader
,
pEntry
);
URLCache_DeleteEntry
(
pHeader
,
pEntry
);
URLCache_DeleteEntryFromHash
(
pHeader
,
urlA
);
URLCache_DeleteEntryFromHash
(
pHeader
,
urlA
);
...
@@ -2931,6 +2922,7 @@ DWORD WINAPI DeleteIE3Cache(HWND hWnd, HINSTANCE hInst, LPSTR lpszCmdLine, int n
...
@@ -2931,6 +2922,7 @@ DWORD WINAPI DeleteIE3Cache(HWND hWnd, HINSTANCE hInst, LPSTR lpszCmdLine, int n
BOOL
WINAPI
IsUrlCacheEntryExpiredA
(
LPCSTR
url
,
DWORD
dwFlags
,
FILETIME
*
pftLastModified
)
BOOL
WINAPI
IsUrlCacheEntryExpiredA
(
LPCSTR
url
,
DWORD
dwFlags
,
FILETIME
*
pftLastModified
)
{
{
LPURLCACHE_HEADER
pHeader
;
LPURLCACHE_HEADER
pHeader
;
struct
_HASH_ENTRY
*
pHashEntry
;
CACHEFILE_ENTRY
*
pEntry
;
CACHEFILE_ENTRY
*
pEntry
;
URL_CACHEFILE_ENTRY
*
pUrlEntry
;
URL_CACHEFILE_ENTRY
*
pUrlEntry
;
URLCACHECONTAINER
*
pContainer
;
URLCACHECONTAINER
*
pContainer
;
...
@@ -2946,7 +2938,7 @@ BOOL WINAPI IsUrlCacheEntryExpiredA( LPCSTR url, DWORD dwFlags, FILETIME* pftLas
...
@@ -2946,7 +2938,7 @@ BOOL WINAPI IsUrlCacheEntryExpiredA( LPCSTR url, DWORD dwFlags, FILETIME* pftLas
if
(
!
(
pHeader
=
URLCacheContainer_LockIndex
(
pContainer
)))
if
(
!
(
pHeader
=
URLCacheContainer_LockIndex
(
pContainer
)))
return
FALSE
;
return
FALSE
;
if
(
!
URLCache_Find
EntryInHash
(
pHeader
,
url
,
&
p
Entry
))
if
(
!
URLCache_Find
Hash
(
pHeader
,
url
,
&
pHash
Entry
))
{
{
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
TRACE
(
"entry %s not found!
\n
"
,
url
);
TRACE
(
"entry %s not found!
\n
"
,
url
);
...
@@ -2954,6 +2946,7 @@ BOOL WINAPI IsUrlCacheEntryExpiredA( LPCSTR url, DWORD dwFlags, FILETIME* pftLas
...
@@ -2954,6 +2946,7 @@ BOOL WINAPI IsUrlCacheEntryExpiredA( LPCSTR url, DWORD dwFlags, FILETIME* pftLas
return
FALSE
;
return
FALSE
;
}
}
pEntry
=
(
CACHEFILE_ENTRY
*
)((
LPBYTE
)
pHeader
+
pHashEntry
->
dwOffsetEntry
);
if
(
pEntry
->
dwSignature
!=
URL_SIGNATURE
)
if
(
pEntry
->
dwSignature
!=
URL_SIGNATURE
)
{
{
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
...
...
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