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
666353d1
Commit
666353d1
authored
Mar 02, 2011
by
Juan Lang
Committed by
Alexandre Julliard
Mar 04, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Move creating cache file to a helper function.
parent
488c2d0c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
27 deletions
+31
-27
http.c
dlls/wininet/http.c
+31
-27
No files found.
dlls/wininet/http.c
View file @
666353d1
...
...
@@ -3843,6 +3843,35 @@ static void HTTP_ProcessExpires(http_request_t *request)
}
}
static
void
HTTP_CacheRequest
(
http_request_t
*
request
)
{
WCHAR
url
[
INTERNET_MAX_URL_LENGTH
];
WCHAR
cacheFileName
[
MAX_PATH
+
1
];
BOOL
b
;
b
=
HTTP_GetRequestURL
(
request
,
url
);
if
(
!
b
)
{
WARN
(
"Could not get URL
\n
"
);
return
;
}
b
=
CreateUrlCacheEntryW
(
url
,
request
->
contentLength
>
0
?
request
->
contentLength
:
0
,
NULL
,
cacheFileName
,
0
);
if
(
b
)
{
HeapFree
(
GetProcessHeap
(),
0
,
request
->
cacheFile
);
CloseHandle
(
request
->
hCacheFile
);
request
->
cacheFile
=
heap_strdupW
(
cacheFileName
);
request
->
hCacheFile
=
CreateFileW
(
request
->
cacheFile
,
GENERIC_WRITE
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
request
->
hCacheFile
==
INVALID_HANDLE_VALUE
)
{
WARN
(
"Could not create file: %u
\n
"
,
GetLastError
());
request
->
hCacheFile
=
NULL
;
}
}
else
{
WARN
(
"Could not create cache entry: %08x
\n
"
,
GetLastError
());
}
}
/***********************************************************************
* HTTP_HttpSendRequestW (internal)
*
...
...
@@ -4117,33 +4146,8 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders,
}
while
(
loop_next
);
if
(
res
==
ERROR_SUCCESS
)
{
WCHAR
url
[
INTERNET_MAX_URL_LENGTH
];
WCHAR
cacheFileName
[
MAX_PATH
+
1
];
BOOL
b
;
b
=
HTTP_GetRequestURL
(
request
,
url
);
if
(
!
b
)
{
WARN
(
"Could not get URL
\n
"
);
goto
lend
;
}
b
=
CreateUrlCacheEntryW
(
url
,
request
->
contentLength
>
0
?
request
->
contentLength
:
0
,
NULL
,
cacheFileName
,
0
);
if
(
b
)
{
HeapFree
(
GetProcessHeap
(),
0
,
request
->
cacheFile
);
CloseHandle
(
request
->
hCacheFile
);
request
->
cacheFile
=
heap_strdupW
(
cacheFileName
);
request
->
hCacheFile
=
CreateFileW
(
request
->
cacheFile
,
GENERIC_WRITE
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
request
->
hCacheFile
==
INVALID_HANDLE_VALUE
)
{
WARN
(
"Could not create file: %u
\n
"
,
GetLastError
());
request
->
hCacheFile
=
NULL
;
}
}
else
{
WARN
(
"Could not create cache entry: %08x
\n
"
,
GetLastError
());
}
}
if
(
res
==
ERROR_SUCCESS
)
HTTP_CacheRequest
(
request
);
lend:
...
...
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