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
6ae84b0b
Commit
6ae84b0b
authored
Aug 03, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 04, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Moved setting HTTP header to separated function.
parent
b1c6f41d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
32 deletions
+49
-32
mshtml_private.h
dlls/mshtml/mshtml_private.h
+3
-1
navigate.c
dlls/mshtml/navigate.c
+9
-31
nsio.c
dlls/mshtml/nsio.c
+37
-0
No files found.
dlls/mshtml/mshtml_private.h
View file @
6ae84b0b
...
...
@@ -467,12 +467,14 @@ typedef struct {
UINT
url_scheme
;
}
nsChannel
;
typedef
struct
ResponseHeader
{
typedef
struct
{
struct
list
entry
;
WCHAR
*
header
;
WCHAR
*
data
;
}
http_header_t
;
HRESULT
set_http_header
(
struct
list
*
,
const
WCHAR
*
,
int
,
const
WCHAR
*
,
int
);
typedef
struct
{
HRESULT
(
*
qi
)(
HTMLDOMNode
*
,
REFIID
,
void
**
);
void
(
*
destructor
)(
HTMLDOMNode
*
);
...
...
dlls/mshtml/navigate.c
View file @
6ae84b0b
...
...
@@ -1104,6 +1104,7 @@ static HRESULT nsChannelBSC_on_response(BSCallback *bsc, DWORD response_code,
LPCWSTR
response_headers
)
{
nsChannelBSC
*
This
=
NSCHANNELBSC_THIS
(
bsc
);
HRESULT
hres
;
This
->
nschannel
->
response_status
=
response_code
;
...
...
@@ -1112,9 +1113,7 @@ static HRESULT nsChannelBSC_on_response(BSCallback *bsc, DWORD response_code,
hdr_start
=
strchrW
(
response_headers
,
'\r'
);
while
(
hdr_start
)
{
const
WCHAR
*
colon
;
struct
ResponseHeader
*
new_header
;
int
len
;
const
WCHAR
*
colon
,
*
value
;
hdr_start
+=
2
;
hdr_end
=
strchrW
(
hdr_start
,
'\r'
);
...
...
@@ -1132,35 +1131,14 @@ static HRESULT nsChannelBSC_on_response(BSCallback *bsc, DWORD response_code,
continue
;
}
new_header
=
heap_alloc
(
sizeof
(
struct
ResponseHeader
));
if
(
!
new_header
)
return
E_OUTOFMEMORY
;
len
=
colon
-
hdr_start
;
new_header
->
header
=
heap_alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
new_header
->
header
)
{
heap_free
(
new_header
);
return
E_OUTOFMEMORY
;
}
memcpy
(
new_header
->
header
,
hdr_start
,
len
*
sizeof
(
WCHAR
));
new_header
->
header
[
len
]
=
0
;
colon
++
;
while
(
*
colon
==
' '
)
colon
++
;
len
=
hdr_end
-
colon
;
new_header
->
data
=
heap_alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
new_header
->
data
)
{
heap_free
(
new_header
->
header
);
heap_free
(
new_header
);
return
E_OUTOFMEMORY
;
}
memcpy
(
new_header
->
data
,
colon
,
len
*
sizeof
(
WCHAR
));
new_header
->
data
[
len
]
=
0
;
value
=
colon
+
1
;
while
(
*
value
==
' '
)
value
++
;
list_add_head
(
&
This
->
nschannel
->
response_headers
,
&
new_header
->
entry
);
TRACE
(
"Adding header to list: (%s):(%s)
\n
"
,
wine_dbgstr_w
(
new_header
->
header
),
wine_dbgstr_w
(
new_header
->
data
));
hres
=
set_http_header
(
&
This
->
nschannel
->
response_headers
,
hdr_start
,
colon
-
hdr_start
,
value
,
hdr_end
-
value
);
if
(
FAILED
(
hres
))
return
hres
;
hdr_start
=
strchrW
(
hdr_start
,
'\r'
);
}
...
...
dlls/mshtml/nsio.c
View file @
6ae84b0b
...
...
@@ -350,6 +350,43 @@ static nsresult get_channel_http_header(struct list *headers, const nsACString *
return
NS_OK
;
}
HRESULT
set_http_header
(
struct
list
*
headers
,
const
WCHAR
*
name
,
int
name_len
,
const
WCHAR
*
value
,
int
value_len
)
{
http_header_t
*
header
;
TRACE
(
"%s: %s
\n
"
,
debugstr_wn
(
name
,
name_len
),
debugstr_wn
(
value
,
value_len
));
header
=
find_http_header
(
headers
,
name
,
name_len
);
if
(
header
)
{
WCHAR
*
new_data
;
new_data
=
heap_strndupW
(
value
,
value_len
);
if
(
!
new_data
)
return
E_OUTOFMEMORY
;
heap_free
(
header
->
data
);
header
->
data
=
new_data
;
}
else
{
header
=
heap_alloc
(
sizeof
(
http_header_t
));
if
(
!
header
)
return
E_OUTOFMEMORY
;
header
->
header
=
heap_strndupW
(
name
,
name_len
);
header
->
data
=
heap_strndupW
(
value
,
value_len
);
if
(
!
header
->
header
||
!
header
->
data
)
{
heap_free
(
header
->
header
);
heap_free
(
header
->
data
);
heap_free
(
header
);
return
E_OUTOFMEMORY
;
}
list_add_tail
(
headers
,
&
header
->
entry
);
}
return
S_OK
;
}
static
void
free_http_headers
(
struct
list
*
list
)
{
http_header_t
*
iter
,
*
iter_next
;
...
...
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