summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Network')
-rw-r--r--Swiften/Network/TLSConnection.cpp6
-rw-r--r--Swiften/Network/TLSConnection.h8
2 files changed, 10 insertions, 4 deletions
diff --git a/Swiften/Network/TLSConnection.cpp b/Swiften/Network/TLSConnection.cpp
index 149548a..c69547d 100644
--- a/Swiften/Network/TLSConnection.cpp
+++ b/Swiften/Network/TLSConnection.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Isode Limited.
+ * Copyright (c) 2011-2015 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -66,6 +66,10 @@ HostAddressPort TLSConnection::getLocalAddress() const {
return connection->getLocalAddress();
}
+TLSContext* TLSConnection::getTLSContext() const {
+ return context;
+}
+
void TLSConnection::handleRawConnectFinished(bool error) {
connection->onConnectFinished.disconnect(boost::bind(&TLSConnection::handleRawConnectFinished, this, _1));
if (error) {
diff --git a/Swiften/Network/TLSConnection.h b/Swiften/Network/TLSConnection.h
index 96525ad..a037eb1 100644
--- a/Swiften/Network/TLSConnection.h
+++ b/Swiften/Network/TLSConnection.h
@@ -6,16 +6,15 @@
#pragma once
-#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>
-#include <Swiften/Base/boost_bsignals.h>
+#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Base/SafeByteArray.h>
+#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Network/Connection.h>
#include <Swiften/TLS/TLSOptions.h>
-
namespace Swift {
class HostAddressPort;
class TLSContextFactory;
@@ -34,6 +33,8 @@ namespace Swift {
virtual HostAddressPort getLocalAddress() const;
+ TLSContext* getTLSContext() const;
+
private:
void handleRawConnectFinished(bool error);
void handleRawDisconnected(const boost::optional<Error>& error);
@@ -42,6 +43,7 @@ namespace Swift {
void handleTLSConnectFinished(bool error);
void handleTLSDataForNetwork(const SafeByteArray& data);
void handleTLSDataForApplication(const SafeByteArray& data);
+
private:
TLSContext* context;
Connection::ref connection;