Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
37f2cc82
Commit
37f2cc82
authored
Sep 13, 2004
by
Robert Shearman
Committed by
Alexandre Julliard
Sep 13, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Store HTTP host header in the same way as most other headers.
parent
914231e8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
23 deletions
+15
-23
http.c
dlls/wininet/http.c
+14
-21
internet.c
dlls/wininet/internet.c
+1
-1
internet.h
dlls/wininet/internet.h
+0
-1
No files found.
dlls/wininet/http.c
View file @
37f2cc82
...
...
@@ -58,14 +58,13 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
wininet
);
static
const
WCHAR
g_szHttp
[]
=
{
' '
,
'H'
,
'T'
,
'T'
,
'P'
,
'/'
,
'1'
,
'.'
,
'0'
,
0
};
static
const
WCHAR
g_szHost
[]
=
{
'\r'
,
'\n'
,
'H'
,
'o'
,
's'
,
't'
,
':'
,
' '
,
0
};
static
const
WCHAR
g_szReferer
[]
=
{
'R'
,
'e'
,
'f'
,
'e'
,
'r'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
g_szAccept
[]
=
{
'A'
,
'c'
,
'c'
,
'e'
,
'p'
,
't'
,
0
};
static
const
WCHAR
g_szUserAgent
[]
=
{
'U'
,
's'
,
'e'
,
'r'
,
'-'
,
'A'
,
'g'
,
'e'
,
'n'
,
't'
,
0
};
static
const
WCHAR
g_szHost
[]
=
{
'H'
,
'o'
,
's'
,
't'
,
0
};
#define HTTPHEADER g_szHttp
#define HTTPHOSTHEADER g_szHost
#define MAXHOSTNAME 100
#define MAX_FIELD_VALUE_LEN 256
#define MAX_FIELD_LEN 256
...
...
@@ -746,10 +745,11 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs,
InternetCrackUrlW
(
lpszReferrer
,
0
,
0
,
&
UrlComponents
);
if
(
strlenW
(
UrlComponents
.
lpszHostName
))
lpwhr
->
lpszHostName
=
WININET_strdupW
(
UrlComponents
.
lpszHostName
);
}
else
{
lpwhr
->
lpszHostName
=
WININET_strdupW
(
lpwhs
->
lpszServerName
);
HTTP_ProcessHeader
(
lpwhr
,
g_szHost
,
UrlComponents
.
lpszHostName
,
HTTP_ADDREQ_FLAG_ADD
|
HTTP_ADDHDR_FLAG_REQ
);
}
else
HTTP_ProcessHeader
(
lpwhr
,
g_szHost
,
lpwhs
->
lpszServerName
,
HTTP_ADDREQ_FLAG_ADD
|
HTTP_ADDHDR_FLAG_REQ
);
if
(
NULL
!=
hIC
->
lpszProxy
&&
hIC
->
lpszProxy
[
0
]
!=
0
)
HTTP_DealWithProxy
(
hIC
,
lpwhs
,
lpwhr
);
...
...
@@ -767,9 +767,9 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs,
HeapFree
(
GetProcessHeap
(),
0
,
agent_header
);
}
len
=
strlenW
(
lpwhr
->
lpszHostNam
e
)
+
strlenW
(
szUrlForm
);
len
=
strlenW
(
lpwhr
->
StdHeaders
[
HTTP_QUERY_HOST
].
lpszValu
e
)
+
strlenW
(
szUrlForm
);
lpszUrl
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
sprintfW
(
lpszUrl
,
szUrlForm
,
lpwhr
->
lpszHostNam
e
);
sprintfW
(
lpszUrl
,
szUrlForm
,
lpwhr
->
StdHeaders
[
HTTP_QUERY_HOST
].
lpszValu
e
);
if
(
!
(
lpwhr
->
hdr
.
dwFlags
&
INTERNET_FLAG_NO_COOKIES
)
&&
InternetGetCookieW
(
lpszUrl
,
NULL
,
NULL
,
&
nCookieSize
))
...
...
@@ -1379,9 +1379,7 @@ static BOOL HTTP_HandleRedirect(LPWININETHTTPREQW lpwhr, LPCWSTR lpszUrl, LPCWST
lpwhs
->
lpszUserName
=
WININET_strdupW
(
userName
);
lpwhs
->
nServerPort
=
urlComponents
.
nPort
;
if
(
NULL
!=
lpwhr
->
lpszHostName
)
HeapFree
(
GetProcessHeap
(),
0
,
lpwhr
->
lpszHostName
);
lpwhr
->
lpszHostName
=
WININET_strdupW
(
hostName
);
HTTP_ProcessHeader
(
lpwhr
,
g_szHost
,
hostName
,
HTTP_ADDREQ_FLAG_ADD
|
HTTP_ADDHDR_FLAG_REQ
);
SendAsyncCallback
(
hIC
,
&
lpwhs
->
hdr
,
lpwhr
->
hdr
.
dwContext
,
INTERNET_STATUS_RESOLVING_NAME
,
...
...
@@ -1524,7 +1522,7 @@ BOOL WINAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders,
DWORD
len
,
n
;
char
*
ascii_req
;
TRACE
(
"Going to url %s %s
\n
"
,
debugstr_w
(
lpwhr
->
lpszHostNam
e
),
debugstr_w
(
lpwhr
->
lpszPath
));
TRACE
(
"Going to url %s %s
\n
"
,
debugstr_w
(
lpwhr
->
StdHeaders
[
HTTP_QUERY_HOST
].
lpszValu
e
),
debugstr_w
(
lpwhr
->
lpszPath
));
loop_next
=
FALSE
;
/* If we don't have a path we set it to root */
...
...
@@ -1602,12 +1600,6 @@ BOOL WINAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders,
}
}
if
(
lpwhr
->
lpszHostName
)
{
req
[
n
++
]
=
HTTPHOSTHEADER
;
req
[
n
++
]
=
lpwhr
->
lpszHostName
;
}
if
(
n
>=
len
)
ERR
(
"oops. buffer overrun
\n
"
);
...
...
@@ -1731,9 +1723,10 @@ BOOL WINAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders,
cookie_data
=
&
buf_cookie
[
nEqualPos
+
1
];
len
=
strlenW
((
domain
?
domain
:
lpwhr
->
lpszHostName
))
+
strlenW
(
lpwhr
->
lpszPath
)
+
9
;
len
=
strlenW
((
domain
?
domain
:
lpwhr
->
StdHeaders
[
HTTP_QUERY_HOST
].
lpszValue
))
+
strlenW
(
lpwhr
->
lpszPath
)
+
9
;
buf_url
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
sprintfW
(
buf_url
,
szFmt
,
(
domain
?
domain
:
lpwhr
->
lpszHostNam
e
));
/* FIXME PATH!!! */
sprintfW
(
buf_url
,
szFmt
,
(
domain
?
domain
:
lpwhr
->
StdHeaders
[
HTTP_QUERY_HOST
].
lpszValu
e
));
/* FIXME PATH!!! */
InternetSetCookieW
(
buf_url
,
cookie_name
,
cookie_data
);
HeapFree
(
GetProcessHeap
(),
0
,
buf_url
);
...
...
@@ -2260,6 +2253,8 @@ INT HTTP_GetStdHeaderIndex(LPCWSTR lpszField)
index
=
HTTP_QUERY_VARY
;
else
if
(
!
strcmpiW
(
lpszField
,
szVia
))
index
=
HTTP_QUERY_VIA
;
else
if
(
!
strcmpiW
(
lpszField
,
g_szHost
))
index
=
HTTP_QUERY_HOST
;
else
{
TRACE
(
"Couldn't find %s in standard header table
\n
"
,
debugstr_w
(
lpszField
));
...
...
@@ -2472,8 +2467,6 @@ static void HTTP_CloseHTTPRequestHandle(LPWININETHANDLEHEADER hdr)
HeapFree
(
GetProcessHeap
(),
0
,
lpwhr
->
lpszPath
);
if
(
lpwhr
->
lpszVerb
)
HeapFree
(
GetProcessHeap
(),
0
,
lpwhr
->
lpszVerb
);
if
(
lpwhr
->
lpszHostName
)
HeapFree
(
GetProcessHeap
(),
0
,
lpwhr
->
lpszHostName
);
if
(
lpwhr
->
lpszRawHeaders
)
HeapFree
(
GetProcessHeap
(),
0
,
lpwhr
->
lpszRawHeaders
);
...
...
dlls/wininet/internet.c
View file @
37f2cc82
...
...
@@ -1768,7 +1768,7 @@ static BOOL INET_QueryOptionHelper(BOOL bIsUnicode, HINTERNET hInternet, DWORD d
WCHAR
url
[
1023
];
static
const
WCHAR
szFmt
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'%'
,
's'
,
'%'
,
's'
,
0
};
sprintfW
(
url
,
szFmt
,
lpreq
->
lpszHostNam
e
,
lpreq
->
lpszPath
);
sprintfW
(
url
,
szFmt
,
lpreq
->
StdHeaders
[
HTTP_QUERY_HOST
].
lpszValu
e
,
lpreq
->
lpszPath
);
TRACE
(
"INTERNET_OPTION_URL: %s
\n
"
,
debugstr_w
(
url
));
if
(
*
lpdwBufferLength
<
strlenW
(
url
)
+
1
)
INTERNET_SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
...
...
dlls/wininet/internet.h
View file @
37f2cc82
...
...
@@ -185,7 +185,6 @@ typedef struct
WININETHANDLEHEADER
hdr
;
LPWSTR
lpszPath
;
LPWSTR
lpszVerb
;
LPWSTR
lpszHostName
;
LPWSTR
lpszRawHeaders
;
WININET_NETCONNECTION
netConnection
;
HTTPHEADERW
StdHeaders
[
HTTP_QUERY_MAX
+
1
];
...
...
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