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
dce9181c
Commit
dce9181c
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 get_cookie directly in HTTP_InsertCookies.
parent
9a741bf3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
23 deletions
+23
-23
cookie.c
dlls/wininet/cookie.c
+1
-1
http.c
dlls/wininet/http.c
+20
-22
internet.h
dlls/wininet/internet.h
+2
-0
No files found.
dlls/wininet/cookie.c
View file @
dce9181c
...
@@ -260,7 +260,7 @@ static void COOKIE_deleteDomain(cookie_domain *deadDomain)
...
@@ -260,7 +260,7 @@ static void COOKIE_deleteDomain(cookie_domain *deadDomain)
HeapFree
(
GetProcessHeap
(),
0
,
deadDomain
);
HeapFree
(
GetProcessHeap
(),
0
,
deadDomain
);
}
}
static
BOOL
get_cookie
(
const
WCHAR
*
host
,
const
WCHAR
*
path
,
WCHAR
*
cookie_data
,
DWORD
*
size
)
BOOL
get_cookie
(
const
WCHAR
*
host
,
const
WCHAR
*
path
,
WCHAR
*
cookie_data
,
DWORD
*
size
)
{
{
unsigned
cnt
=
0
,
len
,
domain_count
=
0
,
cookie_count
=
0
;
unsigned
cnt
=
0
,
len
,
domain_count
=
0
,
cookie_count
=
0
;
cookie_domain
*
domain
;
cookie_domain
*
domain
;
...
...
dlls/wininet/http.c
View file @
dce9181c
...
@@ -3957,32 +3957,30 @@ static DWORD HTTP_SecureProxyConnect(http_request_t *request)
...
@@ -3957,32 +3957,30 @@ static DWORD HTTP_SecureProxyConnect(http_request_t *request)
static
void
HTTP_InsertCookies
(
http_request_t
*
request
)
static
void
HTTP_InsertCookies
(
http_request_t
*
request
)
{
{
static
const
WCHAR
szUrlForm
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'%'
,
's'
,
'%'
,
's'
,
0
};
DWORD
cookie_size
,
size
,
cnt
=
0
;
LPWSTR
lpszCookies
,
lpszUrl
=
NULL
;
HTTPHEADERW
*
host
;
DWORD
nCookieSize
,
size
;
WCHAR
*
cookies
;
LPHTTPHEADERW
Host
=
HTTP_GetHeader
(
request
,
hostW
);
size
=
(
strlenW
(
Host
->
lpszValue
)
+
strlenW
(
szUrlForm
)
+
strlenW
(
request
->
path
))
*
sizeof
(
WCHAR
);
static
const
WCHAR
cookieW
[]
=
{
'C'
,
'o'
,
'o'
,
'k'
,
'i'
,
'e'
,
':'
,
' '
,
0
};
if
(
!
(
lpszUrl
=
heap_alloc
(
size
)))
return
;
sprintfW
(
lpszUrl
,
szUrlForm
,
Host
->
lpszValue
,
request
->
path
);
if
(
InternetGetCookieW
(
lpszUrl
,
NULL
,
NULL
,
&
nCookieSize
))
host
=
HTTP_GetHeader
(
request
,
hostW
);
{
if
(
!
host
)
int
cnt
=
0
;
return
;
static
const
WCHAR
szCookie
[]
=
{
'C'
,
'o'
,
'o'
,
'k'
,
'i'
,
'e'
,
':'
,
' '
,
0
};
size
=
sizeof
(
szCookie
)
+
nCookieSize
*
sizeof
(
WCHAR
)
+
sizeof
(
szCrLf
);
if
(
!
get_cookie
(
host
->
lpszValue
,
request
->
path
,
NULL
,
&
cookie_size
))
if
((
lpszCookies
=
heap_alloc
(
size
)))
return
;
{
cnt
+=
sprintfW
(
lpszCookies
,
szCookie
);
InternetGetCookieW
(
lpszUrl
,
NULL
,
lpszCookies
+
cnt
,
&
nCookieSize
);
strcatW
(
lpszCookies
,
szCrLf
);
HTTP_HttpAddRequestHeadersW
(
request
,
lpszCookies
,
strlenW
(
lpszCookies
),
HTTP_ADDREQ_FLAG_REPLACE
);
size
=
sizeof
(
cookieW
)
+
cookie_size
*
sizeof
(
WCHAR
)
+
sizeof
(
szCrLf
);
HeapFree
(
GetProcessHeap
(),
0
,
lpszCookies
);
if
(
!
(
cookies
=
heap_alloc
(
size
)))
}
return
;
}
HeapFree
(
GetProcessHeap
(),
0
,
lpszUrl
);
cnt
+=
sprintfW
(
cookies
,
cookieW
);
get_cookie
(
host
->
lpszValue
,
request
->
path
,
cookies
+
cnt
,
&
cookie_size
);
strcatW
(
cookies
,
szCrLf
);
HTTP_HttpAddRequestHeadersW
(
request
,
cookies
,
strlenW
(
cookies
),
HTTP_ADDREQ_FLAG_REPLACE
);
heap_free
(
cookies
);
}
}
static
WORD
HTTP_ParseDay
(
LPCWSTR
day
)
static
WORD
HTTP_ParseDay
(
LPCWSTR
day
)
...
...
dlls/wininet/internet.h
View file @
dce9181c
...
@@ -497,6 +497,8 @@ DWORD HTTP_Connect(appinfo_t*,LPCWSTR,
...
@@ -497,6 +497,8 @@ DWORD HTTP_Connect(appinfo_t*,LPCWSTR,
BOOL
GetAddress
(
LPCWSTR
lpszServerName
,
INTERNET_PORT
nServerPort
,
BOOL
GetAddress
(
LPCWSTR
lpszServerName
,
INTERNET_PORT
nServerPort
,
struct
sockaddr
*
psa
,
socklen_t
*
sa_len
)
DECLSPEC_HIDDEN
;
struct
sockaddr
*
psa
,
socklen_t
*
sa_len
)
DECLSPEC_HIDDEN
;
BOOL
get_cookie
(
const
WCHAR
*
,
const
WCHAR
*
,
WCHAR
*
,
DWORD
*
)
DECLSPEC_HIDDEN
;
void
INTERNET_SetLastError
(
DWORD
dwError
)
DECLSPEC_HIDDEN
;
void
INTERNET_SetLastError
(
DWORD
dwError
)
DECLSPEC_HIDDEN
;
DWORD
INTERNET_GetLastError
(
void
)
DECLSPEC_HIDDEN
;
DWORD
INTERNET_GetLastError
(
void
)
DECLSPEC_HIDDEN
;
DWORD
INTERNET_AsyncCall
(
LPWORKREQUEST
lpWorkRequest
)
DECLSPEC_HIDDEN
;
DWORD
INTERNET_AsyncCall
(
LPWORKREQUEST
lpWorkRequest
)
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