Add some code that was lost from nsURL.cpp OpenStream(...). Use the nsIURLGroup if available to open the stream. This allows URL loads to be grouped together.

git-svn-id: svn://10.0.0.236/trunk@17710 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rpotts%netscape.com
1999-01-14 06:12:36 +00:00
parent db5ebeda1e
commit 2c59a6eb70

View File

@@ -42,6 +42,7 @@ extern "C" {
#include "nsIProtocolConnection.h"
#include "nsIProtocolURLFactory.h"
#include "nsIProtocol.h"
#include "nsIURLGroup.h"
#include "nsIServiceManager.h"
#include "nsIEventQueueService.h"
#include "nsXPComCIID.h"
@@ -1106,16 +1107,27 @@ NS_NET nsresult NS_MakeAbsoluteURL(nsIURL* aURL,
NS_NET nsresult NS_OpenURL(nsIURL* aURL, nsIStreamListener* aConsumer)
{
nsINetService *inet = nsnull;
nsresult rv = nsServiceManager::GetService(kNetServiceCID,
kINetServiceIID,
(nsISupports **)&inet);
if (rv != NS_OK) return rv;
nsresult rv;
nsIURLGroup* group = nsnull;
rv = inet->OpenStream(aURL, aConsumer);
rv = aURL->GetURLGroup(&group);
if (NS_SUCCEEDED(rv)) {
if (nsnull != group) {
rv = group->OpenStream(aURL, aConsumer);
NS_RELEASE(group);
} else {
nsINetService *inet = nsnull;
nsServiceManager::ReleaseService(kNetServiceCID, inet);
return rv;
rv = nsServiceManager::GetService(kNetServiceCID,
kINetServiceIID,
(nsISupports **)&inet);
if (NS_SUCCEEDED(rv)) {
rv = inet->OpenStream(aURL, aConsumer);
nsServiceManager::ReleaseService(kNetServiceCID, inet);
}
}
}
return rv;
}
NS_NET nsresult NS_OpenURL(nsIURL* aURL, nsIInputStream* *aNewStream,