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
a1cee892
Commit
a1cee892
authored
Nov 22, 2018
by
Hans Leidekker
Committed by
Alexandre Julliard
Nov 22, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Get rid of session_t.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8d567bc9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
30 deletions
+30
-30
cookie.c
dlls/winhttp/cookie.c
+5
-5
request.c
dlls/winhttp/request.c
+2
-2
session.c
dlls/winhttp/session.c
+14
-14
winhttp_private.h
dlls/winhttp/winhttp_private.h
+9
-9
No files found.
dlls/winhttp/cookie.c
View file @
a1cee892
...
...
@@ -45,7 +45,7 @@ struct domain
struct
list
cookies
;
};
static
struct
domain
*
add_domain
(
s
ession_t
*
session
,
WCHAR
*
name
)
static
struct
domain
*
add_domain
(
s
truct
session
*
session
,
WCHAR
*
name
)
{
struct
domain
*
domain
;
...
...
@@ -117,7 +117,7 @@ static void delete_domain( struct domain *domain )
heap_free
(
domain
);
}
void
destroy_cookies
(
s
ession_t
*
session
)
void
destroy_cookies
(
s
truct
session
*
session
)
{
struct
list
*
item
,
*
next
;
struct
domain
*
domain
;
...
...
@@ -129,7 +129,7 @@ void destroy_cookies( session_t *session )
}
}
static
BOOL
add_cookie
(
s
ession_t
*
session
,
struct
cookie
*
cookie
,
WCHAR
*
domain_name
,
WCHAR
*
path
)
static
BOOL
add_cookie
(
s
truct
session
*
session
,
struct
cookie
*
cookie
,
WCHAR
*
domain_name
,
WCHAR
*
path
)
{
struct
domain
*
domain
=
NULL
;
struct
cookie
*
old_cookie
;
...
...
@@ -268,7 +268,7 @@ BOOL set_cookies( request_t *request, const WCHAR *cookies )
WCHAR
*
buffer
,
*
p
;
WCHAR
*
cookie_domain
=
NULL
,
*
cookie_path
=
NULL
;
struct
attr
*
attr
,
*
domain
=
NULL
,
*
path
=
NULL
;
s
ession_t
*
session
=
request
->
connect
->
session
;
s
truct
session
*
session
=
request
->
connect
->
session
;
struct
cookie
*
cookie
;
int
len
,
used
;
...
...
@@ -324,7 +324,7 @@ end:
BOOL
add_cookie_headers
(
request_t
*
request
)
{
struct
list
*
domain_cursor
;
s
ession_t
*
session
=
request
->
connect
->
session
;
s
truct
session
*
session
=
request
->
connect
->
session
;
EnterCriticalSection
(
&
session
->
cs
);
...
...
dlls/winhttp/request.c
View file @
a1cee892
...
...
@@ -1538,7 +1538,7 @@ static DWORD map_secure_protocols( DWORD mask )
return
ret
;
}
static
BOOL
ensure_cred_handle
(
s
ession_t
*
session
)
static
BOOL
ensure_cred_handle
(
s
truct
session
*
session
)
{
SECURITY_STATUS
status
=
SEC_E_OK
;
...
...
@@ -2176,7 +2176,7 @@ static BOOL send_request( request_t *request, LPCWSTR headers, DWORD headers_len
BOOL
ret
=
FALSE
;
connect_t
*
connect
=
request
->
connect
;
s
ession_t
*
session
=
connect
->
session
;
s
truct
session
*
session
=
connect
->
session
;
char
*
wire_req
;
int
bytes_sent
;
DWORD
len
,
i
,
flags
;
...
...
dlls/winhttp/session.c
View file @
a1cee892
...
...
@@ -88,7 +88,7 @@ BOOL WINAPI WinHttpCheckPlatform( void )
*/
static
void
session_destroy
(
struct
object_header
*
hdr
)
{
s
ession_t
*
session
=
(
session_t
*
)
hdr
;
s
truct
session
*
session
=
(
struct
session
*
)
hdr
;
TRACE
(
"%p
\n
"
,
session
);
...
...
@@ -108,7 +108,7 @@ static void session_destroy( struct object_header *hdr )
static
BOOL
session_query_option
(
struct
object_header
*
hdr
,
DWORD
option
,
void
*
buffer
,
DWORD
*
buflen
)
{
s
ession_t
*
session
=
(
session_t
*
)
hdr
;
s
truct
session
*
session
=
(
struct
session
*
)
hdr
;
switch
(
option
)
{
...
...
@@ -159,7 +159,7 @@ static BOOL session_query_option( struct object_header *hdr, DWORD option, void
static
BOOL
session_set_option
(
struct
object_header
*
hdr
,
DWORD
option
,
void
*
buffer
,
DWORD
buflen
)
{
s
ession_t
*
session
=
(
session_t
*
)
hdr
;
s
truct
session
*
session
=
(
struct
session
*
)
hdr
;
switch
(
option
)
{
...
...
@@ -258,12 +258,12 @@ static const struct object_vtbl session_vtbl =
*/
HINTERNET
WINAPI
WinHttpOpen
(
LPCWSTR
agent
,
DWORD
access
,
LPCWSTR
proxy
,
LPCWSTR
bypass
,
DWORD
flags
)
{
s
ession_t
*
session
;
s
truct
session
*
session
;
HINTERNET
handle
=
NULL
;
TRACE
(
"%s, %u, %s, %s, 0x%08x
\n
"
,
debugstr_w
(
agent
),
access
,
debugstr_w
(
proxy
),
debugstr_w
(
bypass
),
flags
);
if
(
!
(
session
=
heap_alloc_zero
(
sizeof
(
s
ession_t
)
)))
return
NULL
;
if
(
!
(
session
=
heap_alloc_zero
(
sizeof
(
s
truct
session
)
)))
return
NULL
;
session
->
hdr
.
type
=
WINHTTP_HANDLE_TYPE_SESSION
;
session
->
hdr
.
vtbl
=
&
session_vtbl
;
...
...
@@ -447,7 +447,7 @@ static BOOL domain_matches(LPCWSTR server, LPCWSTR domain)
/* Matches INTERNET_MAX_HOST_NAME_LENGTH in wininet.h, also RFC 1035 */
#define MAX_HOST_NAME_LENGTH 256
static
BOOL
should_bypass_proxy
(
s
ession_t
*
session
,
LPCWSTR
server
)
static
BOOL
should_bypass_proxy
(
s
truct
session
*
session
,
LPCWSTR
server
)
{
LPCWSTR
ptr
;
BOOL
ret
=
FALSE
;
...
...
@@ -480,7 +480,7 @@ static BOOL should_bypass_proxy(session_t *session, LPCWSTR server)
BOOL
set_server_for_hostname
(
connect_t
*
connect
,
LPCWSTR
server
,
INTERNET_PORT
port
)
{
s
ession_t
*
session
=
connect
->
session
;
s
truct
session
*
session
=
connect
->
session
;
BOOL
ret
=
TRUE
;
if
(
session
->
proxy_server
&&
!
should_bypass_proxy
(
session
,
server
))
...
...
@@ -546,7 +546,7 @@ end:
HINTERNET
WINAPI
WinHttpConnect
(
HINTERNET
hsession
,
LPCWSTR
server
,
INTERNET_PORT
port
,
DWORD
reserved
)
{
connect_t
*
connect
;
s
ession_t
*
session
;
s
truct
session
*
session
;
HINTERNET
hconnect
=
NULL
;
TRACE
(
"%p, %s, %u, %x
\n
"
,
hsession
,
debugstr_w
(
server
),
port
,
reserved
);
...
...
@@ -556,7 +556,7 @@ HINTERNET WINAPI WinHttpConnect( HINTERNET hsession, LPCWSTR server, INTERNET_PO
set_last_error
(
ERROR_INVALID_PARAMETER
);
return
NULL
;
}
if
(
!
(
session
=
(
s
ession_t
*
)
grab_object
(
hsession
)))
if
(
!
(
session
=
(
s
truct
session
*
)
grab_object
(
hsession
)))
{
set_last_error
(
ERROR_INVALID_HANDLE
);
return
NULL
;
...
...
@@ -1003,7 +1003,7 @@ static BOOL request_set_option( struct object_header *hdr, DWORD option, void *b
}
case
WINHTTP_OPTION_PROXY_USERNAME
:
{
s
ession_t
*
session
=
request
->
connect
->
session
;
s
truct
session
*
session
=
request
->
connect
->
session
;
heap_free
(
session
->
proxy_username
);
if
(
!
(
session
->
proxy_username
=
buffer_to_str
(
buffer
,
buflen
)))
return
FALSE
;
...
...
@@ -1011,7 +1011,7 @@ static BOOL request_set_option( struct object_header *hdr, DWORD option, void *b
}
case
WINHTTP_OPTION_PROXY_PASSWORD
:
{
s
ession_t
*
session
=
request
->
connect
->
session
;
s
truct
session
*
session
=
request
->
connect
->
session
;
heap_free
(
session
->
proxy_password
);
if
(
!
(
session
->
proxy_password
=
buffer_to_str
(
buffer
,
buflen
)))
return
FALSE
;
...
...
@@ -1886,14 +1886,14 @@ BOOL WINAPI WinHttpGetProxyForUrl( HINTERNET hsession, LPCWSTR url, WINHTTP_AUTO
{
WCHAR
*
detected_pac_url
=
NULL
;
const
WCHAR
*
pac_url
;
s
ession_t
*
session
;
s
truct
session
*
session
;
char
*
script
;
DWORD
size
;
BOOL
ret
=
FALSE
;
TRACE
(
"%p, %s, %p, %p
\n
"
,
hsession
,
debugstr_w
(
url
),
options
,
info
);
if
(
!
(
session
=
(
s
ession_t
*
)
grab_object
(
hsession
)))
if
(
!
(
session
=
(
s
truct
session
*
)
grab_object
(
hsession
)))
{
set_last_error
(
ERROR_INVALID_HANDLE
);
return
FALSE
;
...
...
@@ -2114,7 +2114,7 @@ BOOL WINAPI WinHttpSetTimeouts( HINTERNET handle, int resolve, int connect, int
}
case
WINHTTP_HANDLE_TYPE_SESSION
:
{
s
ession_t
*
session
=
(
session_t
*
)
hdr
;
s
truct
session
*
session
=
(
struct
session
*
)
hdr
;
session
->
connect_timeout
=
connect
;
if
(
resolve
<
0
)
resolve
=
0
;
...
...
dlls/winhttp/winhttp_private.h
View file @
a1cee892
...
...
@@ -75,32 +75,32 @@ struct hostdata
struct
list
connections
;
};
typedef
struct
struct
session
{
struct
object_header
hdr
;
CRITICAL_SECTION
cs
;
LPWSTR
agent
;
WCHAR
*
agent
;
DWORD
access
;
int
resolve_timeout
;
int
connect_timeout
;
int
send_timeout
;
int
receive_timeout
;
int
receive_response_timeout
;
LPWSTR
proxy_server
;
LPWSTR
proxy_bypass
;
LPWSTR
proxy_username
;
LPWSTR
proxy_password
;
WCHAR
*
proxy_server
;
WCHAR
*
proxy_bypass
;
WCHAR
*
proxy_username
;
WCHAR
*
proxy_password
;
struct
list
cookie_cache
;
HANDLE
unload_event
;
CredHandle
cred_handle
;
BOOL
cred_handle_initialized
;
DWORD
secure_protocols
;
}
session_t
;
};
typedef
struct
{
struct
object_header
hdr
;
s
ession_t
*
session
;
s
truct
session
*
session
;
LPWSTR
hostname
;
/* final destination of the request */
LPWSTR
servername
;
/* name of the server we directly connect to */
LPWSTR
username
;
...
...
@@ -286,7 +286,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
destroy_cookies
(
s
ession_t
*
)
DECLSPEC_HIDDEN
;
void
destroy_cookies
(
s
truct
session
*
)
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