security/manager/ssl/src/nsTLSSocketProvider.cpp

Wed, 31 Dec 2014 07:16:47 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:16:47 +0100
branch
TOR_BUG_9701
changeset 3
141e0f1194b1
permissions
-rw-r--r--

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 "nsTLSSocketProvider.h"
michael@0 8 #include "nsNSSIOLayer.h"
michael@0 9 #include "nsError.h"
michael@0 10
michael@0 11 nsTLSSocketProvider::nsTLSSocketProvider()
michael@0 12 {
michael@0 13 }
michael@0 14
michael@0 15 nsTLSSocketProvider::~nsTLSSocketProvider()
michael@0 16 {
michael@0 17 }
michael@0 18
michael@0 19 NS_IMPL_ISUPPORTS(nsTLSSocketProvider, nsISocketProvider)
michael@0 20
michael@0 21 NS_IMETHODIMP
michael@0 22 nsTLSSocketProvider::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 true,
michael@0 37 flags);
michael@0 38
michael@0 39 return (NS_FAILED(rv)) ? NS_ERROR_SOCKET_CREATE_FAILED : NS_OK;
michael@0 40 }
michael@0 41
michael@0 42 // Add the SSL IO layer to an existing socket
michael@0 43 NS_IMETHODIMP
michael@0 44 nsTLSSocketProvider::AddToSocket(int32_t family,
michael@0 45 const char *host,
michael@0 46 int32_t port,
michael@0 47 nsIProxyInfo *proxy,
michael@0 48 uint32_t flags,
michael@0 49 PRFileDesc *aSocket,
michael@0 50 nsISupports **securityInfo)
michael@0 51 {
michael@0 52 nsresult rv = nsSSLIOLayerAddToSocket(family,
michael@0 53 host,
michael@0 54 port,
michael@0 55 proxy,
michael@0 56 aSocket,
michael@0 57 securityInfo,
michael@0 58 true,
michael@0 59 flags);
michael@0 60
michael@0 61 return (NS_FAILED(rv)) ? NS_ERROR_SOCKET_CREATE_FAILED : NS_OK;
michael@0 62 }

mercurial