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
b114b2c9
Commit
b114b2c9
authored
Sep 18, 2022
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Sep 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Use standard HTTP_ADD Flags.
parent
4bdf92cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
22 deletions
+17
-22
http.c
dlls/wininet/http.c
+17
-22
No files found.
dlls/wininet/http.c
View file @
b114b2c9
...
...
@@ -58,11 +58,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
wininet
);
#define HTTP_ADDHDR_FLAG_ADD 0x20000000
#define HTTP_ADDHDR_FLAG_ADD_IF_NEW 0x10000000
#define HTTP_ADDHDR_FLAG_COALESCE_WITH_COMMA 0x40000000
#define HTTP_ADDHDR_FLAG_COALESCE_WITH_SEMICOLON 0x01000000
#define HTTP_ADDHDR_FLAG_REPLACE 0x80000000
#define HTTP_ADDHDR_FLAG_REQ 0x02000000
#define COLLECT_TIME 60000
...
...
@@ -1591,7 +1586,7 @@ static BOOL HTTP_InsertAuthorization( http_request_t *request, struct HttpAuthIn
TRACE
(
"Inserting authorization: %s
\n
"
,
debugstr_w
(
authorization
));
HTTP_ProcessHeader
(
request
,
header
,
authorization
,
HTTP_ADDHDR_FLAG_REQ
|
HTTP_ADD
HDR
_FLAG_REPLACE
|
HTTP_ADDREQ_FLAG_ADD
);
HTTP_ADDHDR_FLAG_REQ
|
HTTP_ADD
REQ
_FLAG_REPLACE
|
HTTP_ADDREQ_FLAG_ADD
);
heap_free
(
authorization
);
}
else
...
...
@@ -1620,7 +1615,7 @@ static BOOL HTTP_InsertAuthorization( http_request_t *request, struct HttpAuthIn
TRACE
(
"Inserting authorization: %s
\n
"
,
debugstr_w
(
authorization
));
HTTP_ProcessHeader
(
request
,
header
,
authorization
,
HTTP_ADDHDR_FLAG_REQ
|
HTTP_ADD
HDR_FLAG_REPLACE
|
HTTP_ADDHDR
_FLAG_ADD
);
HTTP_ADDHDR_FLAG_REQ
|
HTTP_ADD
REQ_FLAG_REPLACE
|
HTTP_ADDREQ
_FLAG_ADD
);
heap_free
(
data
);
heap_free
(
authorization
);
}
...
...
@@ -3422,9 +3417,9 @@ static DWORD HTTP_HttpOpenRequestW(http_session_t *session,
{
if
(
!*
lpszAcceptTypes
[
i
])
continue
;
HTTP_ProcessHeader
(
request
,
L"Accept"
,
lpszAcceptTypes
[
i
],
HTTP_ADD
HDR
_FLAG_COALESCE_WITH_COMMA
|
HTTP_ADD
REQ
_FLAG_COALESCE_WITH_COMMA
|
HTTP_ADDHDR_FLAG_REQ
|
(
i
==
0
?
(
HTTP_ADD
HDR_FLAG_REPLACE
|
HTTP_ADDHDR
_FLAG_ADD
)
:
0
));
(
i
==
0
?
(
HTTP_ADD
REQ_FLAG_REPLACE
|
HTTP_ADDREQ
_FLAG_ADD
)
:
0
));
}
}
...
...
@@ -4945,7 +4940,7 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders,
/* add the headers the caller supplied */
if
(
lpszHeaders
&&
dwHeaderLength
)
HTTP_HttpAddRequestHeadersW
(
request
,
lpszHeaders
,
dwHeaderLength
,
HTTP_ADDREQ_FLAG_ADD
|
HTTP_ADD
HDR
_FLAG_REPLACE
);
HTTP_HttpAddRequestHeadersW
(
request
,
lpszHeaders
,
dwHeaderLength
,
HTTP_ADDREQ_FLAG_ADD
|
HTTP_ADD
REQ
_FLAG_REPLACE
);
do
{
...
...
@@ -4974,7 +4969,7 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders,
if
(
request
->
hdr
.
dwFlags
&
INTERNET_FLAG_KEEP_CONNECTION
)
{
HTTP_ProcessHeader
(
request
,
L"Connection"
,
L"Keep-Alive"
,
HTTP_ADDHDR_FLAG_REQ
|
HTTP_ADD
HDR_FLAG_REPLACE
|
HTTP_ADDHDR
_FLAG_ADD
);
HTTP_ADDHDR_FLAG_REQ
|
HTTP_ADD
REQ_FLAG_REPLACE
|
HTTP_ADDREQ
_FLAG_ADD
);
}
HTTP_InsertAuthorization
(
request
,
request
->
authInfo
,
L"Authorization"
);
HTTP_InsertAuthorization
(
request
,
request
->
proxyAuthInfo
,
L"Proxy-Authorization"
);
...
...
@@ -5060,7 +5055,7 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders,
INTERNET_SendCallback
(
&
request
->
hdr
,
request
->
hdr
.
dwContext
,
INTERNET_STATUS_RECEIVING_RESPONSE
,
NULL
,
0
);
if
(
HTTP_GetResponseHeaders
(
request
,
&
responseLen
))
{
http_release_netconn
(
request
,
FALSE
);
...
...
@@ -5991,7 +5986,7 @@ static DWORD HTTP_GetResponseHeaders(http_request_t *request, INT *len)
/* Add status code */
HTTP_ProcessHeader
(
request
,
L"Status"
,
status_code
,
HTTP_ADD
HDR_FLAG_REPLACE
|
HTTP_ADDHDR
_FLAG_ADD
);
HTTP_ADD
REQ_FLAG_REPLACE
|
HTTP_ADDREQ
_FLAG_ADD
);
heap_free
(
request
->
version
);
heap_free
(
request
->
statusText
);
...
...
@@ -6104,7 +6099,7 @@ static LPWSTR * HTTP_InterpretHttpHeader(LPCWSTR buffer)
*
*/
#define COALESCEFLAGS (HTTP_ADD
HDR_FLAG_COALESCE_WITH_COMMA|HTTP_ADDHDR
_FLAG_COALESCE_WITH_SEMICOLON)
#define COALESCEFLAGS (HTTP_ADD
REQ_FLAG_COALESCE_WITH_COMMA|HTTP_ADDREQ
_FLAG_COALESCE_WITH_SEMICOLON)
static
DWORD
HTTP_ProcessHeader
(
http_request_t
*
request
,
LPCWSTR
field
,
LPCWSTR
value
,
DWORD
dwModifier
)
{
...
...
@@ -6118,17 +6113,17 @@ static DWORD HTTP_ProcessHeader(http_request_t *request, LPCWSTR field, LPCWSTR
EnterCriticalSection
(
&
request
->
headers_section
);
/* REPLACE wins out over ADD */
if
(
dwModifier
&
HTTP_ADD
HDR
_FLAG_REPLACE
)
dwModifier
&=
~
HTTP_ADD
HDR
_FLAG_ADD
;
if
(
dwModifier
&
HTTP_ADD
HDR
_FLAG_ADD
)
if
(
dwModifier
&
HTTP_ADD
REQ
_FLAG_REPLACE
)
dwModifier
&=
~
HTTP_ADD
REQ
_FLAG_ADD
;
if
(
dwModifier
&
HTTP_ADD
REQ
_FLAG_ADD
)
index
=
-
1
;
else
index
=
HTTP_GetCustomHeaderIndex
(
request
,
field
,
0
,
request_only
);
if
(
index
>=
0
)
{
if
(
dwModifier
&
HTTP_ADD
HDR
_FLAG_ADD_IF_NEW
)
if
(
dwModifier
&
HTTP_ADD
REQ
_FLAG_ADD_IF_NEW
)
{
LeaveCriticalSection
(
&
request
->
headers_section
);
return
ERROR_HTTP_INVALID_HEADER
;
...
...
@@ -6162,7 +6157,7 @@ static DWORD HTTP_ProcessHeader(http_request_t *request, LPCWSTR field, LPCWSTR
else
lphttpHdr
->
wFlags
&=
~
HDR_ISREQUEST
;
if
(
dwModifier
&
HTTP_ADD
HDR
_FLAG_REPLACE
)
if
(
dwModifier
&
HTTP_ADD
REQ
_FLAG_REPLACE
)
{
HTTP_DeleteCustomHeader
(
request
,
index
);
...
...
@@ -6193,12 +6188,12 @@ static DWORD HTTP_ProcessHeader(http_request_t *request, LPCWSTR field, LPCWSTR
INT
origlen
=
lstrlenW
(
lphttpHdr
->
lpszValue
);
INT
valuelen
=
lstrlenW
(
value
);
if
(
dwModifier
&
HTTP_ADD
HDR
_FLAG_COALESCE_WITH_COMMA
)
if
(
dwModifier
&
HTTP_ADD
REQ
_FLAG_COALESCE_WITH_COMMA
)
{
ch
=
','
;
lphttpHdr
->
wFlags
|=
HDR_COMMADELIMITED
;
}
else
if
(
dwModifier
&
HTTP_ADD
HDR
_FLAG_COALESCE_WITH_SEMICOLON
)
else
if
(
dwModifier
&
HTTP_ADD
REQ
_FLAG_COALESCE_WITH_SEMICOLON
)
{
ch
=
';'
;
lphttpHdr
->
wFlags
|=
HDR_COMMADELIMITED
;
...
...
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