hook up load group for msg protocol so stop will work, r=mscott

This commit is contained in:
bienvenu%netscape.com 2000-01-09 23:38:52 +00:00
Родитель 11b38602ec
Коммит 1237e0a5d0
1 изменённых файлов: 12 добавлений и 1 удалений

Просмотреть файл

@ -177,7 +177,13 @@ NS_IMETHODIMP nsMsgProtocol::OnStartRequest(nsIChannel * aChannel, nsISupports *
nsresult rv = NS_OK;
nsCOMPtr <nsIMsgMailNewsUrl> aMsgUrl = do_QueryInterface(ctxt, &rv);
if (NS_SUCCEEDED(rv) && aMsgUrl)
{
rv = aMsgUrl->SetUrlState(PR_TRUE, NS_OK);
nsCOMPtr <nsILoadGroup> loadGroup;
aMsgUrl->GetLoadGroup(getter_AddRefs(loadGroup));
if (loadGroup)
loadGroup->AddChannel(aChannel, nsnull /* context isupports */);
}
// if we are set up as a channel, we should notify our channel listener that we are starting...
// so pass in ourself as the channel and not the underlying socket or file channel the protocol
@ -194,8 +200,13 @@ NS_IMETHODIMP nsMsgProtocol::OnStopRequest(nsIChannel * aChannel, nsISupports *c
nsresult rv = NS_OK;
nsCOMPtr <nsIMsgMailNewsUrl> aMsgUrl = do_QueryInterface(ctxt, &rv);
if (NS_SUCCEEDED(rv) && aMsgUrl)
{
rv = aMsgUrl->SetUrlState(PR_FALSE, aStatus);
nsCOMPtr <nsILoadGroup> loadGroup;
aMsgUrl->GetLoadGroup(getter_AddRefs(loadGroup));
if (loadGroup)
loadGroup->RemoveChannel(aChannel, nsnull, aStatus, nsnull);
}
// if we are set up as a channel, we should notify our channel listener that we are starting...
// so pass in ourself as the channel and not the underlying socket or file channel the protocol
// happens to be using