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
22679a24
Commit
22679a24
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: Added support for custom post data type.
parent
ac653688
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
21 deletions
+71
-21
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
navigate.c
dlls/mshtml/navigate.c
+51
-16
nsio.c
dlls/mshtml/nsio.c
+19
-5
No files found.
dlls/mshtml/mshtml_private.h
View file @
22679a24
...
...
@@ -462,6 +462,7 @@ typedef struct {
nsWineURI
*
uri
;
nsIInputStream
*
post_data_stream
;
BOOL
parse_stream
;
nsILoadGroup
*
load_group
;
nsIInterfaceRequestor
*
notif_callback
;
nsISupports
*
owner
;
...
...
dlls/mshtml/navigate.c
View file @
22679a24
/*
* Copyright 2006-20
07
Jacek Caban for CodeWeavers
* Copyright 2006-20
10
Jacek Caban for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -679,20 +679,48 @@ static HRESULT parse_headers(const WCHAR *headers, struct list *headers_list)
return
S_OK
;
}
static
HRESULT
read_post_data_stream
(
nsIInputStream
*
stream
,
HGLOBAL
*
post_data
,
ULONG
*
post_data_len
)
{
PRUint32
data_len
=
0
,
available
=
0
;
char
*
data
;
nsresult
nsres
;
nsres
=
nsIInputStream_Available
(
stream
,
&
available
);
if
(
NS_FAILED
(
nsres
))
return
E_FAIL
;
data
=
GlobalAlloc
(
0
,
available
+
1
);
if
(
!
data
)
return
E_OUTOFMEMORY
;
nsres
=
nsIInputStream_Read
(
stream
,
data
,
available
,
&
data_len
);
if
(
NS_FAILED
(
nsres
))
{
GlobalFree
(
data
);
return
E_FAIL
;
}
data
[
data_len
]
=
0
;
*
post_data
=
data
;
*
post_data_len
=
data_len
;
return
S_OK
;
}
static
void
parse_post_data
(
nsIInputStream
*
post_data_stream
,
LPWSTR
*
headers_ret
,
HGLOBAL
*
post_data_ret
,
ULONG
*
post_data_len_ret
)
{
PRUint32
post_data_len
=
0
,
available
=
0
;
ULONG
post_data_len
;
HGLOBAL
post_data
=
NULL
;
LPWSTR
headers
=
NULL
;
DWORD
headers_len
=
0
,
len
;
const
char
*
ptr
,
*
ptr2
,
*
post_data_end
;
nsIInputStream_Available
(
post_data_stream
,
&
available
);
post_data
=
GlobalAlloc
(
0
,
available
+
1
);
nsIInputStream_Read
(
post_data_stream
,
post_data
,
available
,
&
post_data_len
);
HRESULT
hres
;
TRACE
(
"post_data = %s
\n
"
,
debugstr_an
(
post_data
,
post_data_len
));
hres
=
read_post_data_stream
(
post_data_stream
,
&
post_data
,
&
post_data_len
);
if
(
FAILED
(
hres
))
{
FIXME
(
"read_post_data_stream failed: %08x
\n
"
,
hres
);
return
;
}
ptr
=
ptr2
=
post_data
;
post_data_end
=
(
const
char
*
)
post_data
+
post_data_len
;
...
...
@@ -1088,20 +1116,27 @@ static HRESULT nsChannelBSC_start_binding(BSCallback *bsc)
static
HRESULT
nsChannelBSC_init_bindinfo
(
BSCallback
*
bsc
)
{
nsChannelBSC
*
This
=
NSCHANNELBSC_THIS
(
bsc
);
HRESULT
hres
;
if
(
This
->
nschannel
&&
This
->
nschannel
->
post_data_stream
)
{
WCHAR
*
headers
;
HRESULT
hre
s
;
if
(
This
->
nschannel
->
parse_stream
)
{
WCHAR
*
header
s
;
parse_post_data
(
This
->
nschannel
->
post_data_stream
,
&
headers
,
&
This
->
bsc
.
post_data
,
&
This
->
bsc
.
post_data_len
);
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
;
}
else
{
hres
=
read_post_data_stream
(
This
->
nschannel
->
post_data_stream
,
&
This
->
bsc
.
post_data
,
&
This
->
bsc
.
post_data_len
);
if
(
FAILED
(
hres
))
return
hres
;
}
hres
=
parse_headers
(
headers
,
&
This
->
nschannel
->
request_headers
);
heap_free
(
headers
);
if
(
FAILED
(
hres
))
return
hres
;
TRACE
(
"post_data = %s
\n
"
,
debugstr_an
(
This
->
bsc
.
post_data
,
This
->
bsc
.
post_data_len
));
}
return
S_OK
;
...
...
dlls/mshtml/nsio.c
View file @
22679a24
...
...
@@ -1323,17 +1323,31 @@ static nsresult NSAPI nsUploadChannel_SetUploadStream(nsIUploadChannel *iface,
nsChannel
*
This
=
NSUPCHANNEL_THIS
(
iface
);
const
char
*
content_type
;
TRACE
(
"(%p)->(%p %s %d)
\n
"
,
This
,
aStream
,
debugstr_nsacstr
(
aContentType
),
aContentLength
);
static
const
WCHAR
content_typeW
[]
=
{
'C'
,
'o'
,
'n'
,
't'
,
'e'
,
'n'
,
't'
,
'-'
,
'T'
,
'y'
,
'p'
,
'e'
,
0
};
if
(
This
->
post_data_stream
)
nsIInputStream_Release
(
This
->
post_data_stream
);
TRACE
(
"(%p)->(%p %s %d)
\n
"
,
This
,
aStream
,
debugstr_nsacstr
(
aContentType
),
aContentLength
);
This
->
parse_stream
=
TRUE
;
if
(
aContentType
)
{
nsACString_GetData
(
aContentType
,
&
content_type
);
if
(
*
content_type
)
FIXME
(
"Unsupported aContentType argument: %s
\n
"
,
debugstr_a
(
content_type
));
if
(
*
content_type
)
{
WCHAR
*
ct
;
ct
=
heap_strdupAtoW
(
content_type
);
if
(
!
ct
)
return
NS_ERROR_UNEXPECTED
;
set_http_header
(
&
This
->
request_headers
,
content_typeW
,
sizeof
(
content_typeW
)
/
sizeof
(
WCHAR
),
ct
,
strlenW
(
ct
));
heap_free
(
ct
);
This
->
parse_stream
=
FALSE
;
}
}
if
(
This
->
post_data_stream
)
nsIInputStream_Release
(
This
->
post_data_stream
);
if
(
aContentLength
!=
-
1
)
FIXME
(
"Unsupported acontentLength = %d
\n
"
,
aContentLength
);
...
...
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