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
2aaff6e1
Commit
2aaff6e1
authored
Jul 16, 2014
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 16, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Include trailing slash in URL cache hashes.
parent
95db4ce7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
1 deletion
+41
-1
urlcache.c
dlls/wininet/tests/urlcache.c
+40
-0
urlcache.c
dlls/wininet/urlcache.c
+1
-1
No files found.
dlls/wininet/tests/urlcache.c
View file @
2aaff6e1
...
@@ -1035,6 +1035,45 @@ static void test_GetDiskInfoA(void)
...
@@ -1035,6 +1035,45 @@ static void test_GetDiskInfoA(void)
ok
(
error
==
ERROR_INVALID_PARAMETER
,
"got %u expected ERROR_INVALID_PARAMETER
\n
"
,
error
);
ok
(
error
==
ERROR_INVALID_PARAMETER
,
"got %u expected ERROR_INVALID_PARAMETER
\n
"
,
error
);
}
}
static
BOOL
cache_entry_exists
(
const
char
*
url
)
{
static
char
buf
[
10000
];
DWORD
size
=
sizeof
(
buf
);
BOOL
ret
;
ret
=
GetUrlCacheEntryInfoA
(
url
,
(
void
*
)
buf
,
&
size
);
ok
(
ret
||
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"GetUrlCacheEntryInfoA returned %x (%u)
\n
"
,
ret
,
GetLastError
());
return
ret
;
}
static
void
test_trailing_slash
(
void
)
{
char
filename
[
MAX_PATH
];
BYTE
zero_byte
=
0
;
BOOL
ret
;
static
const
FILETIME
filetime_zero
;
static
char
url_with_slash
[]
=
"http://testing.cache.com/"
;
ret
=
CreateUrlCacheEntryA
(
url_with_slash
,
0
,
"html"
,
filename
,
0
);
ok
(
ret
,
"CreateUrlCacheEntry failed with error %d
\n
"
,
GetLastError
());
create_and_write_file
(
filenameA
,
&
zero_byte
,
sizeof
(
zero_byte
));
ret
=
CommitUrlCacheEntryA
(
"Visited: http://testing.cache.com/"
,
NULL
,
filetime_zero
,
filetime_zero
,
NORMAL_CACHE_ENTRY
,
NULL
,
0
,
"html"
,
NULL
);
ok
(
ret
,
"CommitUrlCacheEntry failed with error %d
\n
"
,
GetLastError
());
ok
(
cache_entry_exists
(
"Visited: http://testing.cache.com/"
),
"cache entry does not exist
\n
"
);
ok
(
!
cache_entry_exists
(
"Visited: http://testing.cache.com"
),
"cache entry exists
\n
"
);
ret
=
DeleteUrlCacheEntryA
(
"Visited: http://testing.cache.com/"
);
ok
(
ret
,
"DeleteCacheEntryA failed
\n
"
);
DeleteFileA
(
filename
);
}
START_TEST
(
urlcache
)
START_TEST
(
urlcache
)
{
{
HMODULE
hdll
;
HMODULE
hdll
;
...
@@ -1058,4 +1097,5 @@ START_TEST(urlcache)
...
@@ -1058,4 +1097,5 @@ START_TEST(urlcache)
test_urlcacheW
();
test_urlcacheW
();
test_FindCloseUrlCache
();
test_FindCloseUrlCache
();
test_GetDiskInfoA
();
test_GetDiskInfoA
();
test_trailing_slash
();
}
}
dlls/wininet/urlcache.c
View file @
2aaff6e1
...
@@ -1487,7 +1487,7 @@ static DWORD urlcache_hash_key(LPCSTR lpszKey)
...
@@ -1487,7 +1487,7 @@ static DWORD urlcache_hash_key(LPCSTR lpszKey)
for
(
i
=
0
;
i
<
sizeof
(
key
)
/
sizeof
(
key
[
0
]);
i
++
)
for
(
i
=
0
;
i
<
sizeof
(
key
)
/
sizeof
(
key
[
0
]);
i
++
)
key
[
i
]
=
lookupTable
[(
*
lpszKey
+
i
)
&
0xFF
];
key
[
i
]
=
lookupTable
[(
*
lpszKey
+
i
)
&
0xFF
];
for
(
lpszKey
++
;
*
lpszKey
&&
((
lpszKey
[
0
]
!=
'/'
)
||
(
lpszKey
[
1
]
!=
0
))
;
lpszKey
++
)
for
(
lpszKey
++
;
*
lpszKey
;
lpszKey
++
)
{
{
for
(
i
=
0
;
i
<
sizeof
(
key
)
/
sizeof
(
key
[
0
]);
i
++
)
for
(
i
=
0
;
i
<
sizeof
(
key
)
/
sizeof
(
key
[
0
]);
i
++
)
key
[
i
]
=
lookupTable
[
*
lpszKey
^
key
[
i
]];
key
[
i
]
=
lookupTable
[
*
lpszKey
^
key
[
i
]];
...
...
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