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
2ee89aa2
Commit
2ee89aa2
authored
Nov 06, 2018
by
Hans Leidekker
Committed by
Alexandre Julliard
Nov 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Get rid of domain_t.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ef26d7d4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
24 deletions
+30
-24
cookie.c
dlls/winhttp/cookie.c
+28
-9
session.c
dlls/winhttp/session.c
+1
-7
winhttp_private.h
dlls/winhttp/winhttp_private.h
+1
-8
No files found.
dlls/winhttp/cookie.c
View file @
2ee89aa2
...
...
@@ -38,11 +38,18 @@ struct cookie
WCHAR
*
path
;
};
st
atic
domain_t
*
add_domain
(
session_t
*
session
,
WCHAR
*
name
)
st
ruct
domain
{
domain_t
*
domain
;
struct
list
entry
;
WCHAR
*
name
;
struct
list
cookies
;
};
if
(
!
(
domain
=
heap_alloc_zero
(
sizeof
(
domain_t
)
)))
return
NULL
;
static
struct
domain
*
add_domain
(
session_t
*
session
,
WCHAR
*
name
)
{
struct
domain
*
domain
;
if
(
!
(
domain
=
heap_alloc_zero
(
sizeof
(
struct
domain
)
)))
return
NULL
;
list_init
(
&
domain
->
entry
);
list_init
(
&
domain
->
cookies
);
...
...
@@ -54,7 +61,7 @@ static domain_t *add_domain( session_t *session, WCHAR *name )
return
domain
;
}
static
struct
cookie
*
find_cookie
(
domain_t
*
domain
,
const
WCHAR
*
path
,
const
WCHAR
*
name
)
static
struct
cookie
*
find_cookie
(
struct
domain
*
domain
,
const
WCHAR
*
path
,
const
WCHAR
*
name
)
{
struct
list
*
item
;
struct
cookie
*
cookie
;
...
...
@@ -71,7 +78,7 @@ static struct cookie *find_cookie( domain_t *domain, const WCHAR *path, const WC
return
NULL
;
}
static
BOOL
domain_match
(
const
WCHAR
*
name
,
domain_t
*
domain
,
BOOL
partial
)
static
BOOL
domain_match
(
const
WCHAR
*
name
,
struct
domain
*
domain
,
BOOL
partial
)
{
TRACE
(
"comparing %s with %s
\n
"
,
debugstr_w
(
name
),
debugstr_w
(
domain
->
name
));
...
...
@@ -94,7 +101,7 @@ static void delete_cookie( struct cookie *cookie )
free_cookie
(
cookie
);
}
void
delete_domain
(
domain_t
*
domain
)
static
void
delete_domain
(
struct
domain
*
domain
)
{
struct
cookie
*
cookie
;
struct
list
*
item
,
*
next
;
...
...
@@ -110,9 +117,21 @@ void delete_domain( domain_t *domain )
heap_free
(
domain
);
}
void
destroy_cookies
(
session_t
*
session
)
{
struct
list
*
item
,
*
next
;
struct
domain
*
domain
;
LIST_FOR_EACH_SAFE
(
item
,
next
,
&
session
->
cookie_cache
)
{
domain
=
LIST_ENTRY
(
item
,
struct
domain
,
entry
);
delete_domain
(
domain
);
}
}
static
BOOL
add_cookie
(
session_t
*
session
,
struct
cookie
*
cookie
,
WCHAR
*
domain_name
,
WCHAR
*
path
)
{
domain_t
*
domain
=
NULL
;
struct
domain
*
domain
=
NULL
;
struct
cookie
*
old_cookie
;
struct
list
*
item
;
...
...
@@ -122,7 +141,7 @@ static BOOL add_cookie( session_t *session, struct cookie *cookie, WCHAR *domain
LIST_FOR_EACH
(
item
,
&
session
->
cookie_cache
)
{
domain
=
LIST_ENTRY
(
item
,
domain_t
,
entry
);
domain
=
LIST_ENTRY
(
item
,
struct
domain
,
entry
);
if
(
domain_match
(
domain_name
,
domain
,
FALSE
))
break
;
domain
=
NULL
;
}
...
...
@@ -311,7 +330,7 @@ BOOL add_cookie_headers( request_t *request )
LIST_FOR_EACH
(
domain_cursor
,
&
session
->
cookie_cache
)
{
domain_t
*
domain
=
LIST_ENTRY
(
domain_cursor
,
domain_t
,
entry
);
struct
domain
*
domain
=
LIST_ENTRY
(
domain_cursor
,
struct
domain
,
entry
);
if
(
domain_match
(
request
->
connect
->
servername
,
domain
,
TRUE
))
{
struct
list
*
cookie_cursor
;
...
...
dlls/winhttp/session.c
View file @
2ee89aa2
...
...
@@ -89,19 +89,13 @@ BOOL WINAPI WinHttpCheckPlatform( void )
static
void
session_destroy
(
object_header_t
*
hdr
)
{
session_t
*
session
=
(
session_t
*
)
hdr
;
struct
list
*
item
,
*
next
;
domain_t
*
domain
;
TRACE
(
"%p
\n
"
,
session
);
if
(
session
->
unload_event
)
SetEvent
(
session
->
unload_event
);
if
(
session
->
cred_handle_initialized
)
FreeCredentialsHandle
(
&
session
->
cred_handle
);
destroy_cookies
(
session
);
LIST_FOR_EACH_SAFE
(
item
,
next
,
&
session
->
cookie_cache
)
{
domain
=
LIST_ENTRY
(
item
,
domain_t
,
entry
);
delete_domain
(
domain
);
}
session
->
cs
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
session
->
cs
);
heap_free
(
session
->
agent
);
...
...
dlls/winhttp/winhttp_private.h
View file @
2ee89aa2
...
...
@@ -66,13 +66,6 @@ struct _object_header_t
struct
list
children
;
};
typedef
struct
{
struct
list
entry
;
WCHAR
*
name
;
struct
list
cookies
;
}
domain_t
;
typedef
struct
{
struct
list
entry
;
LONG
ref
;
...
...
@@ -295,7 +288,7 @@ int netconn_get_cipher_strength( netconn_t * ) DECLSPEC_HIDDEN;
BOOL
set_cookies
(
request_t
*
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
BOOL
add_cookie_headers
(
request_t
*
)
DECLSPEC_HIDDEN
;
BOOL
add_request_headers
(
request_t
*
,
LPCWSTR
,
DWORD
,
DWORD
)
DECLSPEC_HIDDEN
;
void
de
lete_domain
(
domai
n_t
*
)
DECLSPEC_HIDDEN
;
void
de
stroy_cookies
(
sessio
n_t
*
)
DECLSPEC_HIDDEN
;
BOOL
set_server_for_hostname
(
connect_t
*
,
LPCWSTR
,
INTERNET_PORT
)
DECLSPEC_HIDDEN
;
void
destroy_authinfo
(
struct
authinfo
*
)
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