From 1ce5786aaa5fc4e4e88dfb73e08d3ac766856495 Mon Sep 17 00:00:00 2001 From: "bryner%uiuc.edu" Date: Sun, 4 Feb 2001 01:16:13 +0000 Subject: [PATCH] Bug 67530 - failure sending mail if PSM not installed. r/sr=mscott. --- netwerk/base/src/nsSocketTransport.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/netwerk/base/src/nsSocketTransport.cpp b/netwerk/base/src/nsSocketTransport.cpp index d9b5d7edaf9c..c291d4ec4fd0 100644 --- a/netwerk/base/src/nsSocketTransport.cpp +++ b/netwerk/base/src/nsSocketTransport.cpp @@ -463,6 +463,10 @@ nsresult nsSocketTransport::Init(nsSocketTransportService* aService, rv = NS_ERROR_OUT_OF_MEMORY; } + nsCOMPtr spService(do_GetService(kSocketProviderService)); + if (!spService) + rv = NS_ERROR_FAILURE; + if (NS_SUCCEEDED(rv) && aSocketTypeCount) { mSocketTypes = (char**) nsMemory::Alloc(aSocketTypeCount * sizeof(char*)); if (!mSocketTypes) @@ -476,6 +480,15 @@ nsresult nsSocketTransport::Init(nsSocketTransportService* aService, #ifdef DEBUG LOG(("nsSocketTransport: pushing io layer: %s\n", socketType)); #endif + + // Before doing anything else, make sure we can get a + // provider for this type of socket. + + nsCOMPtr sProvider; + rv = spService->GetSocketProvider(socketType, getter_AddRefs(sProvider)); + if (NS_FAILED(rv)) + break; + mSocketTypes[mSocketTypeCount] = nsCRT::strdup(socketType); if (!mSocketTypes[mSocketTypeCount]) { rv = NS_ERROR_OUT_OF_MEMORY;