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
ef26d7d4
Commit
ef26d7d4
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 cookie_t.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
41cba1dc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
cookie.c
dlls/winhttp/cookie.c
+16
-16
No files found.
dlls/winhttp/cookie.c
View file @
ef26d7d4
...
@@ -30,13 +30,13 @@
...
@@ -30,13 +30,13 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
winhttp
);
WINE_DEFAULT_DEBUG_CHANNEL
(
winhttp
);
typedef
struct
struct
cookie
{
{
struct
list
entry
;
struct
list
entry
;
WCHAR
*
name
;
WCHAR
*
name
;
WCHAR
*
value
;
WCHAR
*
value
;
WCHAR
*
path
;
WCHAR
*
path
;
}
cookie_t
;
};
static
domain_t
*
add_domain
(
session_t
*
session
,
WCHAR
*
name
)
static
domain_t
*
add_domain
(
session_t
*
session
,
WCHAR
*
name
)
{
{
...
@@ -54,14 +54,14 @@ static domain_t *add_domain( session_t *session, WCHAR *name )
...
@@ -54,14 +54,14 @@ static domain_t *add_domain( session_t *session, WCHAR *name )
return
domain
;
return
domain
;
}
}
static
cookie_t
*
find_cookie
(
domain_t
*
domain
,
const
WCHAR
*
path
,
const
WCHAR
*
name
)
static
struct
cookie
*
find_cookie
(
domain_t
*
domain
,
const
WCHAR
*
path
,
const
WCHAR
*
name
)
{
{
struct
list
*
item
;
struct
list
*
item
;
cookie_t
*
cookie
;
struct
cookie
*
cookie
;
LIST_FOR_EACH
(
item
,
&
domain
->
cookies
)
LIST_FOR_EACH
(
item
,
&
domain
->
cookies
)
{
{
cookie
=
LIST_ENTRY
(
item
,
cookie_t
,
entry
);
cookie
=
LIST_ENTRY
(
item
,
struct
cookie
,
entry
);
if
(
!
strcmpW
(
cookie
->
path
,
path
)
&&
!
strcmpW
(
cookie
->
name
,
name
))
if
(
!
strcmpW
(
cookie
->
path
,
path
)
&&
!
strcmpW
(
cookie
->
name
,
name
))
{
{
TRACE
(
"found %s=%s
\n
"
,
debugstr_w
(
cookie
->
name
),
debugstr_w
(
cookie
->
value
));
TRACE
(
"found %s=%s
\n
"
,
debugstr_w
(
cookie
->
name
),
debugstr_w
(
cookie
->
value
));
...
@@ -80,7 +80,7 @@ static BOOL domain_match( const WCHAR *name, domain_t *domain, BOOL partial )
...
@@ -80,7 +80,7 @@ static BOOL domain_match( const WCHAR *name, domain_t *domain, BOOL partial )
return
TRUE
;
return
TRUE
;
}
}
static
void
free_cookie
(
cookie_t
*
cookie
)
static
void
free_cookie
(
struct
cookie
*
cookie
)
{
{
heap_free
(
cookie
->
name
);
heap_free
(
cookie
->
name
);
heap_free
(
cookie
->
value
);
heap_free
(
cookie
->
value
);
...
@@ -88,7 +88,7 @@ static void free_cookie( cookie_t *cookie )
...
@@ -88,7 +88,7 @@ static void free_cookie( cookie_t *cookie )
heap_free
(
cookie
);
heap_free
(
cookie
);
}
}
static
void
delete_cookie
(
cookie_t
*
cookie
)
static
void
delete_cookie
(
struct
cookie
*
cookie
)
{
{
list_remove
(
&
cookie
->
entry
);
list_remove
(
&
cookie
->
entry
);
free_cookie
(
cookie
);
free_cookie
(
cookie
);
...
@@ -96,12 +96,12 @@ static void delete_cookie( cookie_t *cookie )
...
@@ -96,12 +96,12 @@ static void delete_cookie( cookie_t *cookie )
void
delete_domain
(
domain_t
*
domain
)
void
delete_domain
(
domain_t
*
domain
)
{
{
cookie_t
*
cookie
;
struct
cookie
*
cookie
;
struct
list
*
item
,
*
next
;
struct
list
*
item
,
*
next
;
LIST_FOR_EACH_SAFE
(
item
,
next
,
&
domain
->
cookies
)
LIST_FOR_EACH_SAFE
(
item
,
next
,
&
domain
->
cookies
)
{
{
cookie
=
LIST_ENTRY
(
item
,
cookie_t
,
entry
);
cookie
=
LIST_ENTRY
(
item
,
struct
cookie
,
entry
);
delete_cookie
(
cookie
);
delete_cookie
(
cookie
);
}
}
...
@@ -110,10 +110,10 @@ void delete_domain( domain_t *domain )
...
@@ -110,10 +110,10 @@ void delete_domain( domain_t *domain )
heap_free
(
domain
);
heap_free
(
domain
);
}
}
static
BOOL
add_cookie
(
session_t
*
session
,
cookie_t
*
cookie
,
WCHAR
*
domain_name
,
WCHAR
*
path
)
static
BOOL
add_cookie
(
session_t
*
session
,
struct
cookie
*
cookie
,
WCHAR
*
domain_name
,
WCHAR
*
path
)
{
{
domain_t
*
domain
=
NULL
;
domain_t
*
domain
=
NULL
;
cookie_t
*
old_cookie
;
struct
cookie
*
old_cookie
;
struct
list
*
item
;
struct
list
*
item
;
if
(
!
(
cookie
->
path
=
strdupW
(
path
)))
return
FALSE
;
if
(
!
(
cookie
->
path
=
strdupW
(
path
)))
return
FALSE
;
...
@@ -140,9 +140,9 @@ static BOOL add_cookie( session_t *session, cookie_t *cookie, WCHAR *domain_name
...
@@ -140,9 +140,9 @@ static BOOL add_cookie( session_t *session, cookie_t *cookie, WCHAR *domain_name
return
domain
!=
NULL
;
return
domain
!=
NULL
;
}
}
static
cookie_t
*
parse_cookie
(
const
WCHAR
*
string
)
static
struct
cookie
*
parse_cookie
(
const
WCHAR
*
string
)
{
{
cookie_t
*
cookie
;
struct
cookie
*
cookie
;
const
WCHAR
*
p
;
const
WCHAR
*
p
;
int
len
;
int
len
;
...
@@ -151,7 +151,7 @@ static cookie_t *parse_cookie( const WCHAR *string )
...
@@ -151,7 +151,7 @@ static cookie_t *parse_cookie( const WCHAR *string )
while
(
len
&&
string
[
len
-
1
]
==
' '
)
len
--
;
while
(
len
&&
string
[
len
-
1
]
==
' '
)
len
--
;
if
(
!
len
)
return
NULL
;
if
(
!
len
)
return
NULL
;
if
(
!
(
cookie
=
heap_alloc_zero
(
sizeof
(
cookie_t
)
)))
return
NULL
;
if
(
!
(
cookie
=
heap_alloc_zero
(
sizeof
(
struct
cookie
)
)))
return
NULL
;
list_init
(
&
cookie
->
entry
);
list_init
(
&
cookie
->
entry
);
if
(
!
(
cookie
->
name
=
heap_alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
if
(
!
(
cookie
->
name
=
heap_alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
...
@@ -250,7 +250,7 @@ BOOL set_cookies( request_t *request, const WCHAR *cookies )
...
@@ -250,7 +250,7 @@ BOOL set_cookies( request_t *request, const WCHAR *cookies )
WCHAR
*
cookie_domain
=
NULL
,
*
cookie_path
=
NULL
;
WCHAR
*
cookie_domain
=
NULL
,
*
cookie_path
=
NULL
;
struct
attr
*
attr
,
*
domain
=
NULL
,
*
path
=
NULL
;
struct
attr
*
attr
,
*
domain
=
NULL
,
*
path
=
NULL
;
session_t
*
session
=
request
->
connect
->
session
;
session_t
*
session
=
request
->
connect
->
session
;
cookie_t
*
cookie
;
struct
cookie
*
cookie
;
int
len
,
used
;
int
len
,
used
;
len
=
strlenW
(
cookies
);
len
=
strlenW
(
cookies
);
...
@@ -319,7 +319,7 @@ BOOL add_cookie_headers( request_t *request )
...
@@ -319,7 +319,7 @@ BOOL add_cookie_headers( request_t *request )
LIST_FOR_EACH
(
cookie_cursor
,
&
domain
->
cookies
)
LIST_FOR_EACH
(
cookie_cursor
,
&
domain
->
cookies
)
{
{
cookie_t
*
cookie
=
LIST_ENTRY
(
cookie_cursor
,
cookie_t
,
entry
);
struct
cookie
*
cookie
=
LIST_ENTRY
(
cookie_cursor
,
struct
cookie
,
entry
);
TRACE
(
"comparing path %s with %s
\n
"
,
debugstr_w
(
request
->
path
),
debugstr_w
(
cookie
->
path
));
TRACE
(
"comparing path %s with %s
\n
"
,
debugstr_w
(
request
->
path
),
debugstr_w
(
cookie
->
path
));
...
...
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