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
76eed7d3
Commit
76eed7d3
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: Store request headers in nsChannel if possible.
parent
508aec93
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
2 deletions
+68
-2
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
navigate.c
dlls/mshtml/navigate.c
+65
-2
nsio.c
dlls/mshtml/nsio.c
+2
-0
No files found.
dlls/mshtml/mshtml_private.h
View file @
76eed7d3
...
...
@@ -464,6 +464,7 @@ typedef struct {
char
*
charset
;
PRUint32
response_status
;
struct
list
response_headers
;
struct
list
request_headers
;
UINT
url_scheme
;
}
nsChannel
;
...
...
dlls/mshtml/navigate.c
View file @
76eed7d3
...
...
@@ -1090,9 +1090,18 @@ static HRESULT nsChannelBSC_init_bindinfo(BSCallback *bsc)
nsChannelBSC
*
This
=
NSCHANNELBSC_THIS
(
bsc
);
if
(
This
->
nschannel
&&
This
->
nschannel
->
post_data_stream
)
{
parse_post_data
(
This
->
nschannel
->
post_data_stream
,
&
This
->
bsc
.
headers
,
&
This
->
bsc
.
post_data
,
&
This
->
bsc
.
post_data_len
);
TRACE
(
"headers = %s post_data = %s
\n
"
,
debugstr_w
(
This
->
bsc
.
headers
),
WCHAR
*
headers
;
HRESULT
hres
;
parse_post_data
(
This
->
nschannel
->
post_data_stream
,
&
headers
,
&
This
->
bsc
.
post_data
,
&
This
->
bsc
.
post_data_len
);
TRACE
(
"headers = %s post_data = %s
\n
"
,
debugstr_w
(
headers
),
debugstr_an
(
This
->
bsc
.
post_data
,
This
->
bsc
.
post_data_len
));
hres
=
parse_headers
(
headers
,
&
This
->
nschannel
->
request_headers
);
heap_free
(
headers
);
if
(
FAILED
(
hres
))
return
hres
;
}
return
S_OK
;
...
...
@@ -1174,7 +1183,51 @@ static HRESULT nsChannelBSC_on_response(BSCallback *bsc, DWORD response_code,
static
HRESULT
nsChannelBSC_beginning_transaction
(
BSCallback
*
bsc
,
WCHAR
**
additional_headers
)
{
nsChannelBSC
*
This
=
NSCHANNELBSC_THIS
(
bsc
);
http_header_t
*
iter
;
DWORD
len
=
0
;
WCHAR
*
ptr
;
static
const
WCHAR
content_lengthW
[]
=
{
'C'
,
'o'
,
'n'
,
't'
,
'e'
,
'n'
,
't'
,
'-'
,
'L'
,
'e'
,
'n'
,
'g'
,
't'
,
'h'
,
0
};
if
(
!
This
->
nschannel
)
return
S_FALSE
;
LIST_FOR_EACH_ENTRY
(
iter
,
&
This
->
nschannel
->
request_headers
,
http_header_t
,
entry
)
{
if
(
strcmpW
(
iter
->
header
,
content_lengthW
))
len
+=
strlenW
(
iter
->
header
)
+
2
/* ": " */
+
strlenW
(
iter
->
data
)
+
2
/* "\r\n" */
;
}
if
(
!
len
)
return
S_OK
;
*
additional_headers
=
ptr
=
CoTaskMemAlloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
ptr
)
return
E_OUTOFMEMORY
;
LIST_FOR_EACH_ENTRY
(
iter
,
&
This
->
nschannel
->
request_headers
,
http_header_t
,
entry
)
{
if
(
!
strcmpW
(
iter
->
header
,
content_lengthW
))
continue
;
len
=
strlenW
(
iter
->
header
);
memcpy
(
ptr
,
iter
->
header
,
len
*
sizeof
(
WCHAR
));
ptr
+=
len
;
*
ptr
++
=
':'
;
*
ptr
++
=
' '
;
len
=
strlenW
(
iter
->
data
);
memcpy
(
ptr
,
iter
->
data
,
len
*
sizeof
(
WCHAR
));
ptr
+=
len
;
*
ptr
++
=
'\r'
;
*
ptr
++
=
'\n'
;
}
*
ptr
=
0
;
return
S_OK
;
}
#undef NSCHANNELBSC_THIS
...
...
@@ -1325,6 +1378,16 @@ void channelbsc_set_channel(nsChannelBSC *This, nsChannel *channel, nsIStreamLis
nsISupports_AddRef
(
context
);
This
->
nscontext
=
context
;
}
if
(
This
->
bsc
.
headers
)
{
HRESULT
hres
;
hres
=
parse_headers
(
This
->
bsc
.
headers
,
&
channel
->
request_headers
);
heap_free
(
This
->
bsc
.
headers
);
This
->
bsc
.
headers
=
NULL
;
if
(
FAILED
(
hres
))
WARN
(
"parse_headers failed: %08x
\n
"
,
hres
);
}
}
HRESULT
hlink_frame_navigate
(
HTMLDocument
*
doc
,
LPCWSTR
url
,
...
...
dlls/mshtml/nsio.c
View file @
76eed7d3
...
...
@@ -465,6 +465,7 @@ static nsrefcnt NSAPI nsChannel_Release(nsIHttpChannel *iface)
nsIURI_Release
(
This
->
original_uri
);
free_http_headers
(
&
This
->
response_headers
);
free_http_headers
(
&
This
->
request_headers
);
heap_free
(
This
->
content_type
);
heap_free
(
This
->
charset
);
...
...
@@ -2611,6 +2612,7 @@ static nsresult NSAPI nsIOService_NewChannelFromURI(nsIIOService *iface, nsIURI
ret
->
ref
=
1
;
ret
->
uri
=
wine_uri
;
list_init
(
&
ret
->
response_headers
);
list_init
(
&
ret
->
request_headers
);
nsIURI_AddRef
(
aURI
);
ret
->
original_uri
=
aURI
;
...
...
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