Commit 740d4ea1 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

mshtml: Abort on a cancelled async request properly.

Gecko can cancel an async request sometime between async_start_doc_binding registers it and on_start_nsrequest actually processes it. The latter should not attempt to continue in this case. Signed-off-by: 's avatarGabriel Ivăncescu <gabrielopcode@gmail.com> Signed-off-by: 's avatarJacek Caban <jacek@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 0fd3b8ad
...@@ -51,6 +51,7 @@ typedef struct { ...@@ -51,6 +51,7 @@ typedef struct {
nsIURI *referrer; nsIURI *referrer;
char *content_type; char *content_type;
char *charset; char *charset;
nsresult status;
UINT32 response_status; UINT32 response_status;
char *response_status_text; char *response_status_text;
REQUEST_METHOD request_method; REQUEST_METHOD request_method;
......
...@@ -981,6 +981,10 @@ static HRESULT on_start_nsrequest(nsChannelBSC *This) ...@@ -981,6 +981,10 @@ static HRESULT on_start_nsrequest(nsChannelBSC *This)
{ {
nsresult nsres; nsresult nsres;
/* Async request can be cancelled before we got to it */
if(NS_FAILED(This->nschannel->status))
return E_ABORT; /* FIXME: map status to HRESULT */
This->nschannel->binding = This; This->nschannel->binding = This;
/* FIXME: it's needed for http connections from BindToObject. */ /* FIXME: it's needed for http connections from BindToObject. */
......
...@@ -610,6 +610,9 @@ static nsresult NSAPI nsChannel_Cancel(nsIHttpChannel *iface, nsresult aStatus) ...@@ -610,6 +610,9 @@ static nsresult NSAPI nsChannel_Cancel(nsIHttpChannel *iface, nsresult aStatus)
TRACE("(%p)->(%08lx)\n", This, aStatus); TRACE("(%p)->(%08lx)\n", This, aStatus);
if(NS_FAILED(aStatus))
This->status = aStatus;
if(This->binding && This->binding->bsc.binding) if(This->binding && This->binding->bsc.binding)
IBinding_Abort(This->binding->bsc.binding); IBinding_Abort(This->binding->bsc.binding);
else else
......
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