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
b603c5e0
Commit
b603c5e0
authored
Nov 06, 2018
by
Hans Leidekker
Committed by
Alexandre Julliard
Nov 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Get rid of header_t.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b995ed00
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
21 deletions
+22
-21
request.c
dlls/winhttp/request.c
+17
-16
winhttp_private.h
dlls/winhttp/winhttp_private.h
+5
-5
No files found.
dlls/winhttp/request.c
View file @
b603c5e0
...
...
@@ -265,7 +265,7 @@ static BOOL queue_task( struct task_header *task )
return
TRUE
;
}
static
void
free_header
(
header_t
*
header
)
static
void
free_header
(
struct
header
*
header
)
{
heap_free
(
header
->
field
);
heap_free
(
header
->
value
);
...
...
@@ -293,10 +293,10 @@ static BOOL valid_token_char( WCHAR c )
}
}
static
header_t
*
parse_header
(
LPCWSTR
string
)
static
struct
header
*
parse_header
(
const
WCHAR
*
string
)
{
const
WCHAR
*
p
,
*
q
;
header_t
*
header
;
struct
header
*
header
;
int
len
;
p
=
string
;
...
...
@@ -320,7 +320,7 @@ static header_t *parse_header( LPCWSTR string )
p
++
;
}
len
=
q
-
string
;
if
(
!
(
header
=
heap_alloc_zero
(
sizeof
(
header_t
)
)))
return
NULL
;
if
(
!
(
header
=
heap_alloc_zero
(
sizeof
(
struct
header
)
)))
return
NULL
;
if
(
!
(
header
->
field
=
heap_alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
{
heap_free
(
header
);
...
...
@@ -364,15 +364,15 @@ static int get_header_index( request_t *request, LPCWSTR field, int requested_in
return
index
;
}
static
BOOL
insert_header
(
request_t
*
request
,
header_t
*
header
)
static
BOOL
insert_header
(
request_t
*
request
,
struct
header
*
header
)
{
DWORD
count
=
request
->
num_headers
+
1
;
header_t
*
hdrs
;
struct
header
*
hdrs
;
if
(
request
->
headers
)
hdrs
=
heap_realloc_zero
(
request
->
headers
,
sizeof
(
header_t
)
*
count
);
hdrs
=
heap_realloc_zero
(
request
->
headers
,
sizeof
(
struct
header
)
*
count
);
else
hdrs
=
heap_alloc_zero
(
sizeof
(
header_t
)
);
hdrs
=
heap_alloc_zero
(
sizeof
(
struct
header
)
);
if
(
!
hdrs
)
return
FALSE
;
request
->
headers
=
hdrs
;
...
...
@@ -392,15 +392,16 @@ static BOOL delete_header( request_t *request, DWORD index )
heap_free
(
request
->
headers
[
index
].
field
);
heap_free
(
request
->
headers
[
index
].
value
);
memmove
(
&
request
->
headers
[
index
],
&
request
->
headers
[
index
+
1
],
(
request
->
num_headers
-
index
)
*
sizeof
(
header_t
)
);
memset
(
&
request
->
headers
[
request
->
num_headers
],
0
,
sizeof
(
header_t
)
);
memmove
(
&
request
->
headers
[
index
],
&
request
->
headers
[
index
+
1
],
(
request
->
num_headers
-
index
)
*
sizeof
(
struct
header
)
);
memset
(
&
request
->
headers
[
request
->
num_headers
],
0
,
sizeof
(
struct
header
)
);
return
TRUE
;
}
static
BOOL
process_header
(
request_t
*
request
,
LPCWSTR
field
,
LPCWSTR
value
,
DWORD
flags
,
BOOL
request_only
)
{
int
index
;
header_t
hdr
;
struct
header
hdr
;
TRACE
(
"%s: %s 0x%08x
\n
"
,
debugstr_w
(
field
),
debugstr_w
(
value
),
flags
);
...
...
@@ -435,7 +436,7 @@ static BOOL process_header( request_t *request, LPCWSTR field, LPCWSTR value, DW
{
WCHAR
*
tmp
;
int
len
,
len_orig
,
len_value
;
header_t
*
header
=
&
request
->
headers
[
index
];
struct
header
*
header
=
&
request
->
headers
[
index
];
len_orig
=
strlenW
(
header
->
value
);
len_value
=
strlenW
(
value
);
...
...
@@ -466,7 +467,7 @@ BOOL add_request_headers( request_t *request, LPCWSTR headers, DWORD len, DWORD
{
BOOL
ret
=
FALSE
;
WCHAR
*
buffer
,
*
p
,
*
q
;
header_t
*
header
;
struct
header
*
header
;
if
(
len
==
~
0u
)
len
=
strlenW
(
headers
);
if
(
!
len
)
return
TRUE
;
...
...
@@ -639,7 +640,7 @@ out:
static
BOOL
query_headers
(
request_t
*
request
,
DWORD
level
,
LPCWSTR
name
,
LPVOID
buffer
,
LPDWORD
buflen
,
LPDWORD
index
)
{
header_t
*
header
=
NULL
;
struct
header
*
header
=
NULL
;
BOOL
request_only
,
ret
=
FALSE
;
int
requested_index
,
header_index
=
-
1
;
DWORD
attr
,
len
;
...
...
@@ -2458,7 +2459,7 @@ static BOOL read_reply( request_t *request )
offset
=
buflen
+
crlf_len
-
1
;
for
(;;)
{
header_t
*
header
;
struct
header
*
header
;
buflen
=
MAX_REPLY_LEN
;
if
(
!
read_line
(
request
,
buffer
,
&
buflen
))
return
TRUE
;
...
...
@@ -2499,7 +2500,7 @@ static void record_cookies( request_t *request )
for
(
i
=
0
;
i
<
request
->
num_headers
;
i
++
)
{
header_t
*
set_cookie
=
&
request
->
headers
[
i
];
struct
header
*
set_cookie
=
&
request
->
headers
[
i
];
if
(
!
strcmpiW
(
set_cookie
->
field
,
attr_set_cookie
)
&&
!
set_cookie
->
is_request
)
{
set_cookies
(
request
,
set_cookie
->
value
);
...
...
dlls/winhttp/winhttp_private.h
View file @
b603c5e0
...
...
@@ -129,12 +129,12 @@ typedef struct
size_t
peek_len
;
}
netconn_t
;
typedef
struct
struct
header
{
LPWSTR
field
;
LPWSTR
value
;
WCHAR
*
field
;
WCHAR
*
value
;
BOOL
is_request
;
/* part of request headers? */
}
header_t
;
};
enum
auth_target
{
...
...
@@ -196,7 +196,7 @@ typedef struct
DWORD
read_pos
;
/* current read position in read_buf */
DWORD
read_size
;
/* valid data size in read_buf */
char
read_buf
[
8192
];
/* buffer for already read but not returned data */
header_t
*
headers
;
struct
header
*
headers
;
DWORD
num_headers
;
WCHAR
**
accept_types
;
DWORD
num_accept_types
;
...
...
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