Added support for interrupting streams via the nsINetService::InterruptStream() method.

git-svn-id: svn://10.0.0.236/trunk@13033 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rpotts%netscape.com
1998-10-16 22:20:05 +00:00
parent b07314676c
commit ec3d7d579a
5 changed files with 66 additions and 19 deletions

View File

@@ -310,12 +310,6 @@ nsresult nsNetlibService::OpenStream(nsIURL *aUrl,
SetupURLStruct(aUrl, URL_s);
/*
* Mark the URL as background loading. This prevents many
* client upcall notifications...
*/
URL_s->load_background = FALSE;
/*
* Attach the Data Consumer to the URL_Struct.
*
@@ -449,12 +443,6 @@ nsresult nsNetlibService::OpenBlockingStream(nsIURL *aUrl,
}
#endif /* XP_WIN && !NETLIB_THREAD */
/*
* Mark the URL as background loading. This prevents many
* client upcall notifications...
*/
URL_s->load_background = FALSE;
/*
* Attach the ConnectionInfo object to the URL_Struct.
*
@@ -506,6 +494,38 @@ loser:
return NS_FALSE;
}
NS_IMETHODIMP
nsNetlibService::InterruptStream(nsIURL* aURL)
{
nsIProtocolConnection *pProtocol;
nsresult rv = NS_OK;
if (nsnull == aURL) {
rv = NS_ERROR_NULL_POINTER;
goto done;
}
rv = aURL->QueryInterface(kIProtocolConnectionIID, (void**)&pProtocol);
if (NS_SUCCEEDED(rv)) {
URL_Struct* URL_s;
int status = -1;
pProtocol->GetURLInfo(&URL_s);
if (nsnull != URL_s) {
status = NET_InterruptStream(URL_s);
}
NS_RELEASE(pProtocol);
if (status != 0) {
rv = NS_ERROR_FAILURE;
}
}
done:
return rv;
}
NS_IMETHODIMP
nsNetlibService::GetCookieString(nsIURL *aURL, nsString& aCookie)
{