From 0b0106a97fbf10660cecbfb0056388e61ee30d09 Mon Sep 17 00:00:00 2001 From: Peter Thorson Date: Thu, 28 Mar 2013 22:58:39 -0500 Subject: [PATCH] adds is_secure method to transport endpoint --- websocketpp/transport/asio/endpoint.hpp | 4 ++++ websocketpp/transport/iostream/endpoint.hpp | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/websocketpp/transport/asio/endpoint.hpp b/websocketpp/transport/asio/endpoint.hpp index f3e327a1fb..aa0f3853c4 100644 --- a/websocketpp/transport/asio/endpoint.hpp +++ b/websocketpp/transport/asio/endpoint.hpp @@ -307,6 +307,10 @@ public: boost::asio::io_service& get_io_service() { return *m_io_service; } + + bool is_secure() const { + return socket_type::is_secure(); + } protected: /// Initialize logging /** diff --git a/websocketpp/transport/iostream/endpoint.hpp b/websocketpp/transport/iostream/endpoint.hpp index 423eee29d3..01a1a83034 100644 --- a/websocketpp/transport/iostream/endpoint.hpp +++ b/websocketpp/transport/iostream/endpoint.hpp @@ -71,6 +71,20 @@ public: m_alog->write(log::alevel::devel,"register_ostream"); output_stream = o; } + + /// Tests whether or not the underlying transport is secure + /** + * iostream transport will return false always because it has no information + * about the ultimate remote endpoint. This may or may not be accurate + * depending on the real source of bytes being input. + * + * TODO: allow user settable is_secure flag if this seems useful + * + * @return Whether or not the underlying transport is secure + */ + bool is_secure() const { + return false; + } protected: /// Initialize logging /**