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
98da8e28
Commit
98da8e28
authored
May 11, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
May 11, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Split code from OnDataAvailable.
parent
c3c57247
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
47 deletions
+56
-47
navigate.c
dlls/mshtml/navigate.c
+56
-47
No files found.
dlls/mshtml/navigate.c
View file @
98da8e28
...
...
@@ -172,7 +172,7 @@ static const nsIInputStreamVtbl nsInputStreamVtbl = {
nsInputStream_IsNonBlocking
};
static
nsProtocolStream
*
create_nsprotocol_stream
(
IStream
*
stream
)
static
nsProtocolStream
*
create_nsprotocol_stream
(
void
)
{
nsProtocolStream
*
ret
=
mshtml_alloc
(
sizeof
(
nsProtocolStream
));
...
...
@@ -183,6 +183,60 @@ static nsProtocolStream *create_nsprotocol_stream(IStream *stream)
return
ret
;
}
static
HRESULT
read_stream_data
(
BSCallback
*
This
,
IStream
*
stream
)
{
nsresult
nsres
;
HRESULT
hres
;
if
(
!
This
->
nslistener
)
{
BYTE
buf
[
1024
];
DWORD
read
;
do
{
read
=
0
;
hres
=
IStream_Read
(
stream
,
buf
,
sizeof
(
buf
),
&
read
);
}
while
(
hres
==
S_OK
&&
read
);
return
S_OK
;
}
if
(
!
This
->
nsstream
)
This
->
nsstream
=
create_nsprotocol_stream
();
do
{
hres
=
IStream_Read
(
stream
,
This
->
nsstream
->
buf
,
sizeof
(
This
->
nsstream
->
buf
),
&
This
->
nsstream
->
buf_size
);
if
(
!
This
->
nsstream
->
buf_size
)
break
;
if
(
!
This
->
readed
&&
This
->
nsstream
->
buf_size
>=
2
&&
*
(
WORD
*
)
This
->
nsstream
->
buf
==
0xfeff
)
{
This
->
nschannel
->
charset
=
mshtml_alloc
(
sizeof
(
UTF16_STR
));
memcpy
(
This
->
nschannel
->
charset
,
UTF16_STR
,
sizeof
(
UTF16_STR
));
}
if
(
!
This
->
readed
)
{
nsres
=
nsIStreamListener_OnStartRequest
(
This
->
nslistener
,
(
nsIRequest
*
)
NSCHANNEL
(
This
->
nschannel
),
This
->
nscontext
);
if
(
NS_FAILED
(
nsres
))
FIXME
(
"OnStartRequest failed: %08x
\n
"
,
nsres
);
}
This
->
readed
+=
This
->
nsstream
->
buf_size
;
nsres
=
nsIStreamListener_OnDataAvailable
(
This
->
nslistener
,
(
nsIRequest
*
)
NSCHANNEL
(
This
->
nschannel
),
This
->
nscontext
,
NSINSTREAM
(
This
->
nsstream
),
This
->
readed
-
This
->
nsstream
->
buf_size
,
This
->
nsstream
->
buf_size
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"OnDataAvailable failed: %08x
\n
"
,
nsres
);
if
(
This
->
nsstream
->
buf_size
)
FIXME
(
"buffer is not empty!
\n
"
);
}
while
(
hres
==
S_OK
);
return
S_OK
;
}
#define STATUSCLB_THIS(iface) DEFINE_THIS(BSCallback, BindStatusCallback, iface)
static
HRESULT
WINAPI
BindStatusCallback_QueryInterface
(
IBindStatusCallback
*
iface
,
...
...
@@ -394,55 +448,10 @@ static HRESULT WINAPI BindStatusCallback_OnDataAvailable(IBindStatusCallback *if
DWORD
grfBSCF
,
DWORD
dwSize
,
FORMATETC
*
pformatetc
,
STGMEDIUM
*
pstgmed
)
{
BSCallback
*
This
=
STATUSCLB_THIS
(
iface
);
nsresult
nsres
;
HRESULT
hres
;
TRACE
(
"(%p)->(%08x %d %p %p)
\n
"
,
This
,
grfBSCF
,
dwSize
,
pformatetc
,
pstgmed
);
if
(
This
->
nslistener
)
{
if
(
!
This
->
nsstream
)
This
->
nsstream
=
create_nsprotocol_stream
(
pstgmed
->
u
.
pstm
);
do
{
hres
=
IStream_Read
(
pstgmed
->
u
.
pstm
,
This
->
nsstream
->
buf
,
sizeof
(
This
->
nsstream
->
buf
),
&
This
->
nsstream
->
buf_size
);
if
(
!
This
->
nsstream
->
buf_size
)
break
;
if
(
!
This
->
readed
&&
This
->
nsstream
->
buf_size
>=
2
&&
*
(
WORD
*
)
This
->
nsstream
->
buf
==
0xfeff
)
{
This
->
nschannel
->
charset
=
mshtml_alloc
(
sizeof
(
UTF16_STR
));
memcpy
(
This
->
nschannel
->
charset
,
UTF16_STR
,
sizeof
(
UTF16_STR
));
}
if
(
!
This
->
readed
)
{
nsres
=
nsIStreamListener_OnStartRequest
(
This
->
nslistener
,
(
nsIRequest
*
)
NSCHANNEL
(
This
->
nschannel
),
This
->
nscontext
);
if
(
NS_FAILED
(
nsres
))
FIXME
(
"OnStartRequest failed: %08x
\n
"
,
nsres
);
}
This
->
readed
+=
This
->
nsstream
->
buf_size
;
nsres
=
nsIStreamListener_OnDataAvailable
(
This
->
nslistener
,
(
nsIRequest
*
)
NSCHANNEL
(
This
->
nschannel
),
This
->
nscontext
,
NSINSTREAM
(
This
->
nsstream
),
This
->
readed
-
This
->
nsstream
->
buf_size
,
This
->
nsstream
->
buf_size
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"OnDataAvailable failed: %08x
\n
"
,
nsres
);
if
(
This
->
nsstream
->
buf_size
)
FIXME
(
"buffer is not empty!
\n
"
);
}
while
(
hres
==
S_OK
);
}
else
{
BYTE
buf
[
1024
];
DWORD
read
;
do
{
read
=
0
;
hres
=
IStream_Read
(
pstgmed
->
u
.
pstm
,
buf
,
sizeof
(
buf
),
&
read
);
}
while
(
hres
==
S_OK
&&
read
);
}
return
S_OK
;
return
read_stream_data
(
This
,
pstgmed
->
u
.
pstm
);
}
static
HRESULT
WINAPI
BindStatusCallback_OnObjectAvailable
(
IBindStatusCallback
*
iface
,
...
...
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