Commit 86c09714 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added nsIChannel::Cancel implementation.

parent 11a6bfc6
......@@ -55,6 +55,8 @@ typedef struct {
REQUEST_METHOD request_method;
struct list response_headers;
struct list request_headers;
nsChannelBSC *binding;
} nsChannel;
typedef struct {
......
......@@ -927,6 +927,8 @@ static HRESULT on_start_nsrequest(nsChannelBSC *This)
{
nsresult nsres;
This->nschannel->binding = This;
/* FIXME: it's needed for http connections from BindToObject. */
if(!This->nschannel->response_status)
This->nschannel->response_status = 200;
......@@ -972,12 +974,16 @@ static void on_stop_nsrequest(nsChannelBSC *This, HRESULT result)
WARN("OnStopRequest failed: %08x\n", nsres);
}
if(This->nschannel && This->nschannel->load_group) {
if(This->nschannel) {
if(This->nschannel->load_group) {
nsres = nsILoadGroup_RemoveRequest(This->nschannel->load_group,
(nsIRequest*)&This->nschannel->nsIHttpChannel_iface, NULL, request_result);
if(NS_FAILED(nsres))
ERR("RemoveRequest failed: %08x\n", nsres);
}
if(This->nschannel->binding == This)
This->nschannel->binding = NULL;
}
}
static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream)
......@@ -1217,8 +1223,11 @@ static void nsChannelBSC_destroy(BSCallback *bsc)
{
nsChannelBSC *This = nsChannelBSC_from_BSCallback(bsc);
if(This->nschannel)
if(This->nschannel) {
if(This->nschannel->binding == This)
This->nschannel->binding = NULL;
nsIHttpChannel_Release(&This->nschannel->nsIHttpChannel_iface);
}
if(This->nslistener)
nsIStreamListener_Release(This->nslistener);
if(This->nscontext)
......
......@@ -617,9 +617,13 @@ static nsresult NSAPI nsChannel_Cancel(nsIHttpChannel *iface, nsresult aStatus)
{
nsChannel *This = impl_from_nsIHttpChannel(iface);
FIXME("(%p)->(%08x)\n", This, aStatus);
TRACE("(%p)->(%08x)\n", This, aStatus);
return NS_ERROR_NOT_IMPLEMENTED;
if(This->binding && This->binding->bsc.binding)
IBinding_Abort(This->binding->bsc.binding);
else
WARN("No binding to cancel\n");
return NS_OK;
}
static nsresult NSAPI nsChannel_Suspend(nsIHttpChannel *iface)
......
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