diff --git a/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj b/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj index f5bd33e2ea..e066b66e5c 100644 --- a/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj +++ b/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj @@ -77,6 +77,7 @@ + @@ -88,7 +89,6 @@ - @@ -333,6 +333,10 @@ true true + + true + true + true @@ -352,12 +356,6 @@ true true - - true - true - true - true - true true diff --git a/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj.filters b/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj.filters index aff86d79a7..b0ca0d76a1 100644 --- a/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj.filters +++ b/Subtrees/beast/Builds/VisualStudio2012/beast.vcxproj.filters @@ -686,9 +686,6 @@ beast_core\diagnostic - - beast_asio - beast_asio\sockets @@ -701,9 +698,6 @@ beast_asio\system - - beast_asio\sockets - beast_asio\tests @@ -911,6 +905,12 @@ beast_asio\sockets + + beast_asio\basics + + + beast_asio + @@ -1282,9 +1282,6 @@ beast_asio - - beast_asio\sockets - beast_asio\tests @@ -1387,6 +1384,9 @@ beast_core\memory + + beast_asio\basics + diff --git a/Subtrees/beast/modules/beast_asio/sockets/beast_SslContext.cpp b/Subtrees/beast/modules/beast_asio/basics/SSLContext.cpp similarity index 90% rename from Subtrees/beast/modules/beast_asio/sockets/beast_SslContext.cpp rename to Subtrees/beast/modules/beast_asio/basics/SSLContext.cpp index b6865169f0..bc844ddd40 100644 --- a/Subtrees/beast/modules/beast_asio/sockets/beast_SslContext.cpp +++ b/Subtrees/beast/modules/beast_asio/basics/SSLContext.cpp @@ -16,3 +16,13 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ //============================================================================== + +SSLContext::SSLContext (ContextType& context) + : m_context (context) +{ +} + +SSLContext::~SSLContext () +{ +} + diff --git a/Subtrees/beast/modules/beast_asio/sockets/beast_SslContext.h b/Subtrees/beast/modules/beast_asio/basics/SSLContext.h similarity index 57% rename from Subtrees/beast/modules/beast_asio/sockets/beast_SslContext.h rename to Subtrees/beast/modules/beast_asio/basics/SSLContext.h index f9a48952d5..56874e5616 100644 --- a/Subtrees/beast/modules/beast_asio/sockets/beast_SslContext.h +++ b/Subtrees/beast/modules/beast_asio/basics/SSLContext.h @@ -17,25 +17,45 @@ */ //============================================================================== -#ifndef BEAST_SSLCONTEXT_H_INCLUDED -#define BEAST_SSLCONTEXT_H_INCLUDED +#ifndef BEAST_ASIO_BASICS_SSLCONTEXT_H_INCLUDED +#define BEAST_ASIO_BASICS_SSLCONTEXT_H_INCLUDED -/** An SSL context that wraps a boost::asio::ssl::context. */ -class SslContextBase +/** Simple base class for passing a context around. + This lets derived classes hide their implementation from the headers. +*/ +class SSLContext : public Uncopyable { public: - typedef boost::asio::ssl::context BoostContextType; - virtual ~SslContextBase () { } + virtual ~SSLContext (); - /** Conversion to boost::asio::ssl::context - This lets you pass this object where the real thing is expected. - */ - operator BoostContextType& () + // Saves typing + typedef boost::asio::ssl::context ContextType; + + inline ContextType& get () noexcept { - return getBoostContext (); + return m_context; } - virtual BoostContextType& getBoostContext () noexcept = 0; + inline ContextType const& get () const noexcept + { + return m_context; + } + + // implicit conversion + inline operator ContextType& () noexcept + { + return get (); + } + + inline operator ContextType const& () const noexcept + { + return get (); + } + +protected: + explicit SSLContext (ContextType& context); + + ContextType& m_context; }; #endif diff --git a/Subtrees/beast/modules/beast_asio/beast_asio.cpp b/Subtrees/beast/modules/beast_asio/beast_asio.cpp index 72b45cfa78..6ea8004acf 100644 --- a/Subtrees/beast/modules/beast_asio/beast_asio.cpp +++ b/Subtrees/beast/modules/beast_asio/beast_asio.cpp @@ -29,10 +29,10 @@ namespace beast #include "async/beast_SharedHandler.cpp" #include "basics/beast_PeerRole.cpp" +#include "basics/SSLContext.cpp" #include "sockets/beast_SocketBase.cpp" #include "sockets/beast_Socket.cpp" -#include "sockets/beast_SslContext.cpp" #include "handshake/beast_HandshakeDetectLogicPROXY.cpp" diff --git a/Subtrees/beast/modules/beast_asio/beast_asio.h b/Subtrees/beast/modules/beast_asio/beast_asio.h index 645eb4cab5..f858ab967d 100644 --- a/Subtrees/beast/modules/beast_asio/beast_asio.h +++ b/Subtrees/beast/modules/beast_asio/beast_asio.h @@ -73,12 +73,12 @@ namespace beast #include "basics/beast_BufferType.h" #include "basics/beast_FixedInputBuffer.h" #include "basics/beast_PeerRole.h" +#include "basics/SSLContext.h" #include "sockets/beast_SocketBase.h" #include "sockets/beast_Socket.h" #include "sockets/beast_SocketWrapper.h" #include "sockets/SocketWrapperStrand.h" -#include "sockets/beast_SslContext.h" #include "handshake/beast_InputParser.h" #include "handshake/beast_HandshakeDetectLogic.h"