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
3413d017
Commit
3413d017
authored
May 17, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
May 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Pass host name as substring to get_server.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bd1f39ea
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
19 deletions
+11
-19
http.c
dlls/wininet/http.c
+9
-9
internet.c
dlls/wininet/internet.c
+1
-9
internet.h
dlls/wininet/internet.h
+1
-1
No files found.
dlls/wininet/http.c
View file @
3413d017
...
...
@@ -265,7 +265,7 @@ static BOOL process_host_port(server_t *server)
return
TRUE
;
}
server_t
*
get_server
(
const
WCHAR
*
name
,
INTERNET_PORT
port
,
BOOL
is_https
,
BOOL
do_create
)
server_t
*
get_server
(
substr_t
name
,
INTERNET_PORT
port
,
BOOL
is_https
,
BOOL
do_create
)
{
server_t
*
iter
,
*
server
=
NULL
;
...
...
@@ -275,7 +275,8 @@ server_t *get_server(const WCHAR *name, INTERNET_PORT port, BOOL is_https, BOOL
EnterCriticalSection
(
&
connection_pool_cs
);
LIST_FOR_EACH_ENTRY
(
iter
,
&
connection_pool
,
server_t
,
entry
)
{
if
(
iter
->
port
==
port
&&
!
strcmpW
(
iter
->
name
,
name
)
&&
iter
->
is_https
==
is_https
)
{
if
(
iter
->
port
==
port
&&
name
.
len
==
strlenW
(
iter
->
name
)
&&
!
strncmpW
(
iter
->
name
,
name
.
str
,
name
.
len
)
&&
iter
->
is_https
==
is_https
)
{
server
=
iter
;
server_addref
(
server
);
break
;
...
...
@@ -289,7 +290,7 @@ server_t *get_server(const WCHAR *name, INTERNET_PORT port, BOOL is_https, BOOL
server
->
port
=
port
;
server
->
is_https
=
is_https
;
list_init
(
&
server
->
conn_pool
);
server
->
name
=
heap_str
dupW
(
name
);
server
->
name
=
heap_str
ndupW
(
name
.
str
,
name
.
len
);
if
(
server
->
name
&&
process_host_port
(
server
))
{
list_add_head
(
&
connection_pool
,
&
server
->
entry
);
}
else
{
...
...
@@ -1788,7 +1789,6 @@ static BOOL HTTP_DealWithProxy(appinfo_t *hIC, http_session_t *session, http_req
static
const
WCHAR
protoHttp
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
0
};
static
const
WCHAR
szHttp
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
0
};
static
const
WCHAR
szFormat
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'%'
,
's'
,
0
};
WCHAR
buf
[
INTERNET_MAX_HOST_NAME_LENGTH
];
WCHAR
protoProxy
[
INTERNET_MAX_URL_LENGTH
];
DWORD
protoProxyLen
=
INTERNET_MAX_URL_LENGTH
;
WCHAR
proxy
[
INTERNET_MAX_URL_LENGTH
];
...
...
@@ -1799,8 +1799,7 @@ static BOOL HTTP_DealWithProxy(appinfo_t *hIC, http_session_t *session, http_req
memset
(
&
UrlComponents
,
0
,
sizeof
UrlComponents
);
UrlComponents
.
dwStructSize
=
sizeof
UrlComponents
;
UrlComponents
.
lpszHostName
=
buf
;
UrlComponents
.
dwHostNameLength
=
INTERNET_MAX_HOST_NAME_LENGTH
;
UrlComponents
.
dwHostNameLength
=
1
;
if
(
!
INTERNET_FindProxyForProtocol
(
hIC
->
proxy
,
protoHttp
,
protoProxy
,
&
protoProxyLen
))
return
FALSE
;
...
...
@@ -1821,7 +1820,8 @@ static BOOL HTTP_DealWithProxy(appinfo_t *hIC, http_session_t *session, http_req
if
(
is_https
&&
UrlComponents
.
nPort
==
INTERNET_INVALID_PORT_NUMBER
)
UrlComponents
.
nPort
=
INTERNET_DEFAULT_HTTPS_PORT
;
new_server
=
get_server
(
UrlComponents
.
lpszHostName
,
UrlComponents
.
nPort
,
is_https
,
TRUE
);
new_server
=
get_server
(
substr
(
UrlComponents
.
lpszHostName
,
UrlComponents
.
dwHostNameLength
),
UrlComponents
.
nPort
,
is_https
,
TRUE
);
if
(
!
new_server
)
return
FALSE
;
...
...
@@ -3391,7 +3391,7 @@ static DWORD HTTP_HttpOpenRequestW(http_session_t *session,
request
->
session
=
session
;
list_add_head
(
&
session
->
hdr
.
children
,
&
request
->
hdr
.
entry
);
request
->
server
=
get_server
(
s
ession
->
hostName
,
session
->
hostPort
,
(
dwFlags
&
INTERNET_FLAG_SECURE
)
!=
0
,
TRUE
);
request
->
server
=
get_server
(
s
ubstrz
(
session
->
hostName
)
,
session
->
hostPort
,
(
dwFlags
&
INTERNET_FLAG_SECURE
)
!=
0
,
TRUE
);
if
(
!
request
->
server
)
{
WININET_Release
(
&
request
->
hdr
);
return
ERROR_OUTOFMEMORY
;
...
...
@@ -4204,7 +4204,7 @@ static DWORD HTTP_HandleRedirect(http_request_t *request, LPCWSTR lpszUrl)
if
(
strcmpiW
(
request
->
server
->
name
,
hostName
)
||
request
->
server
->
port
!=
urlComponents
.
nPort
)
{
server_t
*
new_server
;
new_server
=
get_server
(
hostName
,
urlComponents
.
nPort
,
urlComponents
.
nScheme
==
INTERNET_SCHEME_HTTPS
,
TRUE
);
new_server
=
get_server
(
substrz
(
hostName
)
,
urlComponents
.
nPort
,
urlComponents
.
nScheme
==
INTERNET_SCHEME_HTTPS
,
TRUE
);
server_release
(
request
->
server
);
request
->
server
=
new_server
;
}
...
...
dlls/wininet/internet.c
View file @
3413d017
...
...
@@ -4496,7 +4496,6 @@ BOOL WINAPI InternetGetSecurityInfoByURLW(LPCWSTR lpszURL, PCCERT_CHAIN_CONTEXT
{
URL_COMPONENTSW
url
=
{
sizeof
(
url
)};
server_t
*
server
;
WCHAR
*
hostname
;
BOOL
res
;
TRACE
(
"(%s %p %p)
\n
"
,
debugstr_w
(
lpszURL
),
ppCertChain
,
pdwSecureFlags
);
...
...
@@ -4508,14 +4507,7 @@ BOOL WINAPI InternetGetSecurityInfoByURLW(LPCWSTR lpszURL, PCCERT_CHAIN_CONTEXT
return
FALSE
;
}
hostname
=
heap_strndupW
(
url
.
lpszHostName
,
url
.
dwHostNameLength
);
if
(
!
hostname
)
{
SetLastError
(
ERROR_OUTOFMEMORY
);
return
FALSE
;
}
server
=
get_server
(
hostname
,
url
.
nPort
,
TRUE
,
FALSE
);
heap_free
(
hostname
);
server
=
get_server
(
substr
(
url
.
lpszHostName
,
url
.
dwHostNameLength
),
url
.
nPort
,
TRUE
,
FALSE
);
if
(
!
server
)
{
SetLastError
(
ERROR_INTERNET_ITEM_NOT_FOUND
);
return
FALSE
;
...
...
dlls/wininet/internet.h
View file @
3413d017
...
...
@@ -467,7 +467,7 @@ DWORD NETCON_set_timeout(netconn_t *connection, BOOL send, DWORD value) DECLSPEC
int
sock_send
(
int
fd
,
const
void
*
msg
,
size_t
len
,
int
flags
)
DECLSPEC_HIDDEN
;
int
sock_recv
(
int
fd
,
void
*
msg
,
size_t
len
,
int
flags
)
DECLSPEC_HIDDEN
;
server_t
*
get_server
(
const
WCHAR
*
,
INTERNET_PORT
,
BOOL
,
BOOL
)
DECLSPEC_HIDDEN
;
server_t
*
get_server
(
substr_t
,
INTERNET_PORT
,
BOOL
,
BOOL
)
DECLSPEC_HIDDEN
;
DWORD
create_req_file
(
const
WCHAR
*
,
req_file_t
**
)
DECLSPEC_HIDDEN
;
void
req_file_release
(
req_file_t
*
)
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