Wed, 31 Dec 2014 07:16:47 +0100
Revert simplistic fix pending revisit of Mozilla integration attempt.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
michael@0 | 2 | * |
michael@0 | 3 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #include "nsSSLSocketProvider.h" |
michael@0 | 8 | #include "nsNSSIOLayer.h" |
michael@0 | 9 | #include "nsError.h" |
michael@0 | 10 | |
michael@0 | 11 | nsSSLSocketProvider::nsSSLSocketProvider() |
michael@0 | 12 | { |
michael@0 | 13 | } |
michael@0 | 14 | |
michael@0 | 15 | nsSSLSocketProvider::~nsSSLSocketProvider() |
michael@0 | 16 | { |
michael@0 | 17 | } |
michael@0 | 18 | |
michael@0 | 19 | NS_IMPL_ISUPPORTS(nsSSLSocketProvider, nsISocketProvider) |
michael@0 | 20 | |
michael@0 | 21 | NS_IMETHODIMP |
michael@0 | 22 | nsSSLSocketProvider::NewSocket(int32_t family, |
michael@0 | 23 | const char *host, |
michael@0 | 24 | int32_t port, |
michael@0 | 25 | nsIProxyInfo *proxy, |
michael@0 | 26 | uint32_t flags, |
michael@0 | 27 | PRFileDesc **_result, |
michael@0 | 28 | nsISupports **securityInfo) |
michael@0 | 29 | { |
michael@0 | 30 | nsresult rv = nsSSLIOLayerNewSocket(family, |
michael@0 | 31 | host, |
michael@0 | 32 | port, |
michael@0 | 33 | proxy, |
michael@0 | 34 | _result, |
michael@0 | 35 | securityInfo, |
michael@0 | 36 | false, |
michael@0 | 37 | flags); |
michael@0 | 38 | return (NS_FAILED(rv)) ? NS_ERROR_SOCKET_CREATE_FAILED : NS_OK; |
michael@0 | 39 | } |
michael@0 | 40 | |
michael@0 | 41 | // Add the SSL IO layer to an existing socket |
michael@0 | 42 | NS_IMETHODIMP |
michael@0 | 43 | nsSSLSocketProvider::AddToSocket(int32_t family, |
michael@0 | 44 | const char *host, |
michael@0 | 45 | int32_t port, |
michael@0 | 46 | nsIProxyInfo *proxy, |
michael@0 | 47 | uint32_t flags, |
michael@0 | 48 | PRFileDesc *aSocket, |
michael@0 | 49 | nsISupports **securityInfo) |
michael@0 | 50 | { |
michael@0 | 51 | nsresult rv = nsSSLIOLayerAddToSocket(family, |
michael@0 | 52 | host, |
michael@0 | 53 | port, |
michael@0 | 54 | proxy, |
michael@0 | 55 | aSocket, |
michael@0 | 56 | securityInfo, |
michael@0 | 57 | false, |
michael@0 | 58 | flags); |
michael@0 | 59 | |
michael@0 | 60 | return (NS_FAILED(rv)) ? NS_ERROR_SOCKET_CREATE_FAILED : NS_OK; |
michael@0 | 61 | } |