mshtml: Fix handling offset in BSCallback.
This commit is contained in:
parent
ea905eab09
commit
9def0ca2a6
|
@ -160,6 +160,7 @@ struct BSCallback {
|
||||||
LPWSTR headers;
|
LPWSTR headers;
|
||||||
HGLOBAL post_data;
|
HGLOBAL post_data;
|
||||||
ULONG post_data_len;
|
ULONG post_data_len;
|
||||||
|
ULONG readed;
|
||||||
|
|
||||||
nsChannel *nschannel;
|
nsChannel *nschannel;
|
||||||
nsIStreamListener *nslistener;
|
nsIStreamListener *nslistener;
|
||||||
|
|
|
@ -365,19 +365,20 @@ static HRESULT WINAPI BindStatusCallback_OnDataAvailable(IBindStatusCallback *if
|
||||||
|
|
||||||
do {
|
do {
|
||||||
hres = IStream_Read(pstgmed->u.pstm, This->nsstream->buf, sizeof(This->nsstream->buf),
|
hres = IStream_Read(pstgmed->u.pstm, This->nsstream->buf, sizeof(This->nsstream->buf),
|
||||||
&This->nsstream->buf_size);
|
&This->nsstream->buf_size);
|
||||||
if(This->nsstream->buf_size) {
|
if(!This->nsstream->buf_size)
|
||||||
nsres = nsIStreamListener_OnDataAvailable(This->nslistener,
|
|
||||||
(nsIRequest*)NSCHANNEL(This->nschannel), This->nscontext,
|
|
||||||
NSINSTREAM(This->nsstream), 0 /* FIXME */, dwSize);
|
|
||||||
if(NS_FAILED(nsres))
|
|
||||||
FIXME("OnDataAvailable failed: %08lx\n", nsres);
|
|
||||||
|
|
||||||
if(This->nsstream->buf_size)
|
|
||||||
FIXME("buffer is not empty!\n");
|
|
||||||
}else {
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
nsres = nsIStreamListener_OnDataAvailable(This->nslistener,
|
||||||
|
(nsIRequest*)NSCHANNEL(This->nschannel), This->nscontext,
|
||||||
|
NSINSTREAM(This->nsstream), This->readed, This->nsstream->buf_size);
|
||||||
|
if(NS_FAILED(nsres))
|
||||||
|
FIXME("OnDataAvailable failed: %08lx\n", nsres);
|
||||||
|
|
||||||
|
if(This->nsstream->buf_size)
|
||||||
|
FIXME("buffer is not empty!\n");
|
||||||
|
|
||||||
|
This->readed += This->nsstream->buf_size;
|
||||||
}while(hres == S_OK);
|
}while(hres == S_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -575,6 +576,7 @@ BSCallback *create_bscallback(HTMLDocument *doc, LPCOLESTR url)
|
||||||
ret->post_data = NULL;
|
ret->post_data = NULL;
|
||||||
ret->headers = NULL;
|
ret->headers = NULL;
|
||||||
ret->post_data_len = 0;
|
ret->post_data_len = 0;
|
||||||
|
ret->readed = 0;
|
||||||
ret->nschannel = NULL;
|
ret->nschannel = NULL;
|
||||||
ret->nslistener = NULL;
|
ret->nslistener = NULL;
|
||||||
ret->nscontext = NULL;
|
ret->nscontext = NULL;
|
||||||
|
|
Loading…
Reference in New Issue