From bf6199d52799c6fefa4e518dca5e776a03ff65a4 Mon Sep 17 00:00:00 2001 From: "mscott%netscape.com" Date: Wed, 7 Feb 2001 05:54:35 +0000 Subject: [PATCH] Bug #63193 --> if we can't find a protocol handler for the specified scheme then create the default protocol handler and use it instead. sr=rpotts git-svn-id: svn://10.0.0.236/trunk@86500 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/netwerk/base/src/nsIOService.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mozilla/netwerk/base/src/nsIOService.cpp b/mozilla/netwerk/base/src/nsIOService.cpp index 796e1dba39a..e5c5c8aba94 100644 --- a/mozilla/netwerk/base/src/nsIOService.cpp +++ b/mozilla/netwerk/base/src/nsIOService.cpp @@ -222,7 +222,14 @@ nsIOService::GetProtocolHandler(const char* scheme, nsIProtocolHandler* *result) rv = nsServiceManager::GetService(buf, NS_GET_IID(nsIProtocolHandler), (nsISupports **)result); if (NS_FAILED(rv)) - return NS_ERROR_UNKNOWN_PROTOCOL; + { + // okay we don't have a protocol handler to handle this url type, so use the default protocol handler. + // this will cause urls to get dispatched out to the OS ('cause we can't do anything with them) when + // we try to read from a channel created by the default protocol handler. + + rv = nsServiceManager::GetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX"default", NS_GET_IID(nsIProtocolHandler), (nsISupports **)result); + if (NS_FAILED(rv)) return NS_ERROR_UNKNOWN_PROTOCOL; + } CacheProtocolHandler(scheme, *result);