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
2e2ed52c
Commit
2e2ed52c
authored
May 19, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
May 19, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Use set_cookie directly in HTTP_ProcessCookies.
parent
dce9181c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
16 deletions
+26
-16
cookie.c
dlls/wininet/cookie.c
+1
-1
http.c
dlls/wininet/http.c
+24
-15
internet.h
dlls/wininet/internet.h
+1
-0
No files found.
dlls/wininet/cookie.c
View file @
2e2ed52c
...
...
@@ -414,7 +414,7 @@ BOOL WINAPI InternetGetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName,
return
r
;
}
static
BOOL
set_cookie
(
LPCWSTR
domain
,
LPCWSTR
path
,
LPCWSTR
cookie_name
,
LPCWSTR
cookie_data
)
BOOL
set_cookie
(
LPCWSTR
domain
,
LPCWSTR
path
,
LPCWSTR
cookie_name
,
LPCWSTR
cookie_data
)
{
cookie_domain
*
thisCookieDomain
=
NULL
;
cookie
*
thisCookie
;
...
...
dlls/wininet/http.c
View file @
2e2ed52c
...
...
@@ -720,26 +720,35 @@ static void HTTP_ProcessCookies( http_request_t *request )
int
numCookies
=
0
;
LPHTTPHEADERW
setCookieHeader
;
while
((
HeaderIndex
=
HTTP_GetCustomHeaderIndex
(
request
,
szSet_Cookie
,
numCookies
,
FALSE
))
!=
-
1
)
if
(
request
->
hdr
.
dwFlags
&
INTERNET_FLAG_NO_COOKIES
)
return
;
while
((
HeaderIndex
=
HTTP_GetCustomHeaderIndex
(
request
,
szSet_Cookie
,
numCookies
++
,
FALSE
))
!=
-
1
)
{
HTTPHEADERW
*
host
;
const
WCHAR
*
data
;
WCHAR
*
name
;
setCookieHeader
=
&
request
->
custHeaders
[
HeaderIndex
];
if
(
!
(
request
->
hdr
.
dwFlags
&
INTERNET_FLAG_NO_COOKIES
)
&&
setCookieHeader
->
lpszValue
)
{
int
len
;
static
const
WCHAR
szFmt
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'%'
,
's'
,
'%'
,
's'
,
0
};
LPWSTR
buf_url
;
LPHTTPHEADERW
Host
;
if
(
!
setCookieHeader
->
lpszValue
)
continue
;
Host
=
HTTP_GetHeader
(
request
,
hostW
);
len
=
lstrlenW
(
Host
->
lpszValue
)
+
9
+
lstrlenW
(
request
->
path
);
buf_url
=
heap_alloc
(
len
*
sizeof
(
WCHAR
));
sprintfW
(
buf_url
,
szFmt
,
Host
->
lpszValue
,
request
->
path
);
InternetSetCookieW
(
buf_url
,
NULL
,
setCookieHeader
->
lpszValue
);
host
=
HTTP_GetHeader
(
request
,
hostW
);
if
(
!
host
)
continue
;
HeapFree
(
GetProcessHeap
(),
0
,
buf_url
);
}
numCookies
++
;
data
=
strchrW
(
setCookieHeader
->
lpszValue
,
'='
);
if
(
!
data
)
continue
;
name
=
heap_strndupW
(
setCookieHeader
->
lpszValue
,
data
-
setCookieHeader
->
lpszValue
);
if
(
!
name
)
continue
;
data
++
;
set_cookie
(
host
->
lpszValue
,
request
->
path
,
name
,
data
);
heap_free
(
name
);
}
}
...
...
dlls/wininet/internet.h
View file @
2e2ed52c
...
...
@@ -498,6 +498,7 @@ BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort,
struct
sockaddr
*
psa
,
socklen_t
*
sa_len
)
DECLSPEC_HIDDEN
;
BOOL
get_cookie
(
const
WCHAR
*
,
const
WCHAR
*
,
WCHAR
*
,
DWORD
*
)
DECLSPEC_HIDDEN
;
BOOL
set_cookie
(
const
WCHAR
*
,
const
WCHAR
*
,
const
WCHAR
*
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
void
INTERNET_SetLastError
(
DWORD
dwError
)
DECLSPEC_HIDDEN
;
DWORD
INTERNET_GetLastError
(
void
)
DECLSPEC_HIDDEN
;
...
...
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