michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsSSLSocketProvider.h" michael@0: #include "nsNSSIOLayer.h" michael@0: #include "nsError.h" michael@0: michael@0: nsSSLSocketProvider::nsSSLSocketProvider() michael@0: { michael@0: } michael@0: michael@0: nsSSLSocketProvider::~nsSSLSocketProvider() michael@0: { michael@0: } michael@0: michael@0: NS_IMPL_ISUPPORTS(nsSSLSocketProvider, nsISocketProvider) michael@0: michael@0: NS_IMETHODIMP michael@0: nsSSLSocketProvider::NewSocket(int32_t family, michael@0: const char *host, michael@0: int32_t port, michael@0: nsIProxyInfo *proxy, michael@0: uint32_t flags, michael@0: PRFileDesc **_result, michael@0: nsISupports **securityInfo) michael@0: { michael@0: nsresult rv = nsSSLIOLayerNewSocket(family, michael@0: host, michael@0: port, michael@0: proxy, michael@0: _result, michael@0: securityInfo, michael@0: false, michael@0: flags); michael@0: return (NS_FAILED(rv)) ? NS_ERROR_SOCKET_CREATE_FAILED : NS_OK; michael@0: } michael@0: michael@0: // Add the SSL IO layer to an existing socket michael@0: NS_IMETHODIMP michael@0: nsSSLSocketProvider::AddToSocket(int32_t family, michael@0: const char *host, michael@0: int32_t port, michael@0: nsIProxyInfo *proxy, michael@0: uint32_t flags, michael@0: PRFileDesc *aSocket, michael@0: nsISupports **securityInfo) michael@0: { michael@0: nsresult rv = nsSSLIOLayerAddToSocket(family, michael@0: host, michael@0: port, michael@0: proxy, michael@0: aSocket, michael@0: securityInfo, michael@0: false, michael@0: flags); michael@0: michael@0: return (NS_FAILED(rv)) ? NS_ERROR_SOCKET_CREATE_FAILED : NS_OK; michael@0: }