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
4f51b6c1
Commit
4f51b6c1
authored
Jul 03, 2008
by
Alexander Morozov
Committed by
Alexandre Julliard
Jul 07, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Add port number to Host HTTP header.
parent
ad2f53db
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
7 deletions
+30
-7
http.c
dlls/wininet/http.c
+30
-3
http.c
dlls/wininet/tests/http.c
+0
-4
No files found.
dlls/wininet/http.c
View file @
4f51b6c1
...
...
@@ -1453,14 +1453,20 @@ static DWORD HTTPREQ_QueryOption(WININETHANDLEHEADER *hdr, DWORD option, void *b
WCHAR
url
[
INTERNET_MAX_URL_LENGTH
];
HTTPHEADERW
*
host
;
DWORD
len
;
WCHAR
*
pch
;
static
const
WCHAR
formatW
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'%'
,
's'
,
'%'
,
's
'
,
0
};
static
const
WCHAR
httpW
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/
'
,
0
};
static
const
WCHAR
hostW
[]
=
{
'H'
,
'o'
,
's'
,
't'
,
0
};
TRACE
(
"INTERNET_OPTION_URL
\n
"
);
host
=
HTTP_GetHeader
(
req
,
hostW
);
sprintfW
(
url
,
formatW
,
host
->
lpszValue
,
req
->
lpszPath
);
strcpyW
(
url
,
httpW
);
strcatW
(
url
,
host
->
lpszValue
);
if
(
NULL
!=
(
pch
=
strchrW
(
url
+
strlenW
(
httpW
),
':'
)))
*
pch
=
0
;
strcatW
(
url
,
req
->
lpszPath
);
TRACE
(
"INTERNET_OPTION_URL: %s
\n
"
,
debugstr_w
(
url
));
if
(
unicode
)
{
...
...
@@ -1885,9 +1891,11 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs,
LPWININETHTTPREQW
lpwhr
;
LPWSTR
lpszCookies
;
LPWSTR
lpszUrl
=
NULL
;
LPWSTR
lpszHostName
=
NULL
;
DWORD
nCookieSize
;
HINTERNET
handle
=
NULL
;
static
const
WCHAR
szUrlForm
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'%'
,
's'
,
0
};
static
const
WCHAR
szHostForm
[]
=
{
'%'
,
's'
,
':'
,
'%'
,
'u'
,
0
};
DWORD
len
;
LPHTTPHEADERW
Host
;
...
...
@@ -1914,6 +1922,14 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs,
lpwhr
->
lpHttpSession
=
lpwhs
;
list_add_head
(
&
lpwhs
->
hdr
.
children
,
&
lpwhr
->
hdr
.
entry
);
lpszHostName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WCHAR
)
*
(
strlenW
(
lpwhs
->
lpszHostName
)
+
7
/* length of ":65535" + 1 */
));
if
(
NULL
==
lpszHostName
)
{
INTERNET_SetLastError
(
ERROR_OUTOFMEMORY
);
goto
lend
;
}
handle
=
WININET_AllocHandle
(
&
lpwhr
->
hdr
);
if
(
NULL
==
handle
)
{
...
...
@@ -1968,7 +1984,17 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs,
else
lpwhr
->
lpszVersion
=
WININET_strdupW
(
g_szHttp1_1
);
HTTP_ProcessHeader
(
lpwhr
,
szHost
,
lpwhs
->
lpszHostName
,
HTTP_ADDREQ_FLAG_ADD
|
HTTP_ADDHDR_FLAG_REQ
);
if
(
lpwhs
->
nHostPort
!=
INTERNET_INVALID_PORT_NUMBER
&&
lpwhs
->
nHostPort
!=
INTERNET_DEFAULT_HTTP_PORT
&&
lpwhs
->
nHostPort
!=
INTERNET_DEFAULT_HTTPS_PORT
)
{
sprintfW
(
lpszHostName
,
szHostForm
,
lpwhs
->
lpszHostName
,
lpwhs
->
nHostPort
);
HTTP_ProcessHeader
(
lpwhr
,
szHost
,
lpszHostName
,
HTTP_ADDREQ_FLAG_ADD
|
HTTP_ADDHDR_FLAG_REQ
);
}
else
HTTP_ProcessHeader
(
lpwhr
,
szHost
,
lpwhs
->
lpszHostName
,
HTTP_ADDREQ_FLAG_ADD
|
HTTP_ADDHDR_FLAG_REQ
);
if
(
lpwhs
->
nServerPort
==
INTERNET_INVALID_PORT_NUMBER
)
lpwhs
->
nServerPort
=
(
dwFlags
&
INTERNET_FLAG_SECURE
?
...
...
@@ -2014,6 +2040,7 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs,
sizeof
(
handle
));
lend:
HeapFree
(
GetProcessHeap
(),
0
,
lpszHostName
);
if
(
lpwhr
)
WININET_Release
(
&
lpwhr
->
hdr
);
...
...
dlls/wininet/tests/http.c
View file @
4f51b6c1
...
...
@@ -1734,7 +1734,6 @@ static void test_connection_header(int port)
size
=
sizeof
(
status
);
ret
=
HttpQueryInfo
(
req
,
HTTP_QUERY_STATUS_CODE
|
HTTP_QUERY_FLAG_NUMBER
,
&
status
,
&
size
,
NULL
);
ok
(
ret
,
"HttpQueryInfo failed
\n
"
);
todo_wine
ok
(
status
==
200
,
"request failed with status %u
\n
"
,
status
);
InternetCloseHandle
(
req
);
...
...
@@ -1749,7 +1748,6 @@ static void test_connection_header(int port)
size
=
sizeof
(
status
);
ret
=
HttpQueryInfo
(
req
,
HTTP_QUERY_STATUS_CODE
|
HTTP_QUERY_FLAG_NUMBER
,
&
status
,
&
size
,
NULL
);
ok
(
ret
,
"HttpQueryInfo failed
\n
"
);
todo_wine
ok
(
status
==
200
,
"request failed with status %u
\n
"
,
status
);
InternetCloseHandle
(
req
);
...
...
@@ -1764,7 +1762,6 @@ static void test_connection_header(int port)
size
=
sizeof
(
status
);
ret
=
HttpQueryInfo
(
req
,
HTTP_QUERY_STATUS_CODE
|
HTTP_QUERY_FLAG_NUMBER
,
&
status
,
&
size
,
NULL
);
ok
(
ret
,
"HttpQueryInfo failed
\n
"
);
todo_wine
ok
(
status
==
200
,
"request failed with status %u
\n
"
,
status
);
InternetCloseHandle
(
req
);
...
...
@@ -1779,7 +1776,6 @@ static void test_connection_header(int port)
size
=
sizeof
(
status
);
ret
=
HttpQueryInfo
(
req
,
HTTP_QUERY_STATUS_CODE
|
HTTP_QUERY_FLAG_NUMBER
,
&
status
,
&
size
,
NULL
);
ok
(
ret
,
"HttpQueryInfo failed
\n
"
);
todo_wine
ok
(
status
==
200
,
"request failed with status %u
\n
"
,
status
);
InternetCloseHandle
(
req
);
...
...
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