Commit 9def0ca2 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Fix handling offset in BSCallback.

parent ea905eab
......@@ -160,6 +160,7 @@ struct BSCallback {
LPWSTR headers;
HGLOBAL post_data;
ULONG post_data_len;
ULONG readed;
nsChannel *nschannel;
nsIStreamListener *nslistener;
......
......@@ -365,19 +365,20 @@ static HRESULT WINAPI BindStatusCallback_OnDataAvailable(IBindStatusCallback *if
do {
hres = IStream_Read(pstgmed->u.pstm, This->nsstream->buf, sizeof(This->nsstream->buf),
&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 {
&This->nsstream->buf_size);
if(!This->nsstream->buf_size)
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);
}
......@@ -575,6 +576,7 @@ BSCallback *create_bscallback(HTMLDocument *doc, LPCOLESTR url)
ret->post_data = NULL;
ret->headers = NULL;
ret->post_data_len = 0;
ret->readed = 0;
ret->nschannel = NULL;
ret->nslistener = NULL;
ret->nscontext = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment