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
59f2e837
Commit
59f2e837
authored
May 02, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
May 02, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Allocate buffer for host name in HTTP_HttpOpenRequestW only if needed.
parent
aa612ec3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
http.c
dlls/wininet/http.c
+13
-13
No files found.
dlls/wininet/http.c
View file @
59f2e837
...
...
@@ -2792,8 +2792,6 @@ static DWORD HTTP_HttpOpenRequestW(http_session_t *session,
{
appinfo_t
*
hIC
=
NULL
;
http_request_t
*
request
;
LPWSTR
lpszHostName
=
NULL
;
static
const
WCHAR
szHostForm
[]
=
{
'%'
,
's'
,
':'
,
'%'
,
'u'
,
0
};
DWORD
len
,
res
;
TRACE
(
"-->
\n
"
);
...
...
@@ -2819,13 +2817,6 @@ static DWORD HTTP_HttpOpenRequestW(http_session_t *session,
request
->
session
=
session
;
list_add_head
(
&
session
->
hdr
.
children
,
&
request
->
hdr
.
entry
);
lpszHostName
=
heap_alloc
(
sizeof
(
WCHAR
)
*
(
strlenW
(
session
->
hostName
)
+
7
/* length of ":65535" + 1 */
));
if
(
NULL
==
lpszHostName
)
{
res
=
ERROR_OUTOFMEMORY
;
goto
lend
;
}
if
((
res
=
NETCON_init
(
&
request
->
netConnection
,
dwFlags
&
INTERNET_FLAG_SECURE
))
!=
ERROR_SUCCESS
)
goto
lend
;
if
(
dwFlags
&
INTERNET_FLAG_IGNORE_CERT_CN_INVALID
)
...
...
@@ -2877,9 +2868,19 @@ static DWORD HTTP_HttpOpenRequestW(http_session_t *session,
session
->
hostPort
!=
INTERNET_DEFAULT_HTTP_PORT
&&
session
->
hostPort
!=
INTERNET_DEFAULT_HTTPS_PORT
)
{
sprintfW
(
lpszHostName
,
szHostForm
,
session
->
hostName
,
session
->
hostPort
);
HTTP_ProcessHeader
(
request
,
hostW
,
lpszHostName
,
HTTP_ADDREQ_FLAG_ADD
|
HTTP_ADDHDR_FLAG_REQ
);
WCHAR
*
host_name
;
static
const
WCHAR
host_formatW
[]
=
{
'%'
,
's'
,
':'
,
'%'
,
'u'
,
0
};
host_name
=
heap_alloc
((
strlenW
(
session
->
hostName
)
+
7
/* length of ":65535" + 1 */
)
*
sizeof
(
WCHAR
));
if
(
!
host_name
)
{
res
=
ERROR_OUTOFMEMORY
;
goto
lend
;
}
sprintfW
(
host_name
,
host_formatW
,
session
->
hostName
,
session
->
hostPort
);
HTTP_ProcessHeader
(
request
,
hostW
,
host_name
,
HTTP_ADDREQ_FLAG_ADD
|
HTTP_ADDHDR_FLAG_REQ
);
heap_free
(
host_name
);
}
else
HTTP_ProcessHeader
(
request
,
hostW
,
session
->
hostName
,
...
...
@@ -2905,7 +2906,6 @@ static DWORD HTTP_HttpOpenRequestW(http_session_t *session,
lend:
TRACE
(
"<-- %u (%p)
\n
"
,
res
,
request
);
HeapFree
(
GetProcessHeap
(),
0
,
lpszHostName
);
if
(
res
!=
ERROR_SUCCESS
)
{
WININET_Release
(
&
request
->
hdr
);
*
ret
=
NULL
;
...
...
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