Remove unused and obsolete classes and tidy up:

Many classes required to support type-erasure of handlers and boost::asio
types are now obsolete, so these classes and files are removed:
HTTPClientType, FixedInputBuffer, PeerRole, socket_wrapper,
client_session, basic_url, abstract_socket, buffer_sequence, memory_buffer,
enable_wait_for_async, shared_handler, wrap_handler, streambuf,
ContentBodyBuffer, SSLContext, completion-handler based handshake detectors.
These structural changes are made:
* Some missing includes added to headers
* asio module directory flattened
This commit is contained in:
Vinnie Falco
2014-10-25 17:59:04 -07:00
parent 8be8853c33
commit ec96d5afa0
93 changed files with 185 additions and 10453 deletions

View File

@@ -21,6 +21,7 @@
#include <ripple/basics/LoggedTimings.h>
#include <ripple/basics/Sustain.h>
#include <ripple/common/seconds_clock.h>
#include <ripple/common/RippleSSLContext.h>
#include <ripple/app/main/Tuning.h>
#include <ripple/app/misc/ProofOfWorkFactory.h>
#include <ripple/core/LoadFeeTrack.h>
@@ -193,8 +194,8 @@ public:
std::unique_ptr <DatabaseCon> mLedgerDB;
std::unique_ptr <DatabaseCon> mWalletDB;
std::unique_ptr <beast::asio::SSLContext> m_peerSSLContext;
std::unique_ptr <beast::asio::SSLContext> m_wsSSLContext;
std::unique_ptr <SSLContext> m_peerSSLContext;
std::unique_ptr <SSLContext> m_wsSSLContext;
std::unique_ptr <Overlay> m_peers;
std::unique_ptr <RPCDoor> m_rpcDoor;
std::unique_ptr <WSDoor> m_wsPublicDoor;

View File

@@ -20,20 +20,65 @@
#ifndef RIPPLE_COMMON_SSLCONTEXT_H_INCLUDED
#define RIPPLE_COMMON_SSLCONTEXT_H_INCLUDED
#include <beast/module/asio/basics/SSLContext.h>
#include <boost/asio/ssl/context.hpp>
#include <beast/utility/noexcept.h>
#include <string>
namespace ripple {
/** Simple base class for passing a context around.
This lets derived classes hide their implementation from the headers.
*/
class SSLContext
{
public:
virtual ~SSLContext ();
// Saves typing
typedef boost::asio::ssl::context ContextType;
inline ContextType& get () noexcept
{
return m_context;
}
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);
SSLContext(SSLContext const&) = delete;
SSLContext& operator= (SSLContext const&) = delete;
ContextType& m_context;
};
//------------------------------------------------------------------------------
/** The SSL contexts used by Ripple.
This is what Ripple uses for its secure connections. The ECDSA curve
parameters are predefined and verified to be secure. The context is set to
sslv23, Transport Layer Security / General. This is primarily used for peer to peer servers that don't care
about certificates or identity verification.
sslv23, Transport Layer Security / General. This is primarily used for
peer to peer servers that don't care about certificates or
identity verification.
*/
class RippleSSLContext : public beast::asio::SSLContext
// VFALCO NOTE The comment above is out of date
class RippleSSLContext : public SSLContext
{
public:
/** Retrieve raw DH parameters.

View File

@@ -20,7 +20,8 @@
#include <ripple/common/ResolverAsio.h>
#include <beast/asio/IPAddressConversion.h>
#include <beast/asio/placeholders.h>
#include <beast/module/asio/asio.h>
#include <beast/module/asio/AsyncObject.h>
#include <beast/threads/WaitableEvent.h>
#include <boost/asio.hpp>
#include <atomic>
#include <cassert>

View File

@@ -18,12 +18,10 @@
//==============================================================================
#include <ripple/common/RippleSSLContext.h>
#include <ripple/common/seconds_clock.h>
#include <beast/container/aged_unordered_set.h>
#include <beast/module/core/diagnostic/FatalError.h>
#include <beast/utility/static_initializer.h>
#include <cstdint>
#include <sstream>
@@ -413,4 +411,17 @@ std::string RippleSSLContext::getRawDHParams (int keySize)
return RippleSSLContextImp::getRawDHParams (keySize);
}
//------------------------------------------------------------------------------
SSLContext::SSLContext (ContextType& context)
: m_context (context)
{
}
SSLContext::~SSLContext ()
{
}
//------------------------------------------------------------------------------
}

View File

@@ -20,8 +20,8 @@
#ifndef RIPPLE_HTTP_SERVER_H_INCLUDED
#define RIPPLE_HTTP_SERVER_H_INCLUDED
#include <ripple/common/RippleSSLContext.h>
#include <beast/net/IPEndpoint.h>
#include <beast/module/asio/basics/SSLContext.h>
#include <beast/utility/Journal.h>
#include <beast/utility/PropertyStream.h>
#include <boost/system/error_code.hpp>
@@ -47,13 +47,13 @@ struct Port
Security security;
std::uint16_t port;
beast::IP::Endpoint addr;
beast::asio::SSLContext* context;
SSLContext* context;
Port ();
Port (Port const& other);
Port& operator= (Port const& other);
Port (std::uint16_t port_, beast::IP::Endpoint const& addr_,
Security security_, beast::asio::SSLContext* context_);
Security security_, SSLContext* context_);
};
bool operator== (Port const& lhs, Port const& rhs);

View File

@@ -21,10 +21,9 @@
#define RIPPLE_HTTP_SESSION_H_INCLUDED
#include <beast/http/message.h>
#include <beast/smart_ptr/SharedPtr.h>
#include <beast/net/IPEndpoint.h>
#include <beast/utility/Journal.h>
#include <beast/module/asio/http/HTTPRequest.h>
#include <beast/module/asio/HTTPRequest.h>
#include <ostream>
namespace ripple {

View File

@@ -45,7 +45,7 @@ Port& Port::operator= (Port const& other)
}
Port::Port (std::uint16_t port_, beast::IP::Endpoint const& addr_,
Security security_, beast::asio::SSLContext* context_)
Security security_, SSLContext* context_)
: security (security_)
, port (port_)
, addr (addr_)

View File

@@ -21,7 +21,7 @@
#define RIPPLE_SITEFILES_LOGIC_H_INCLUDED
#include <beast/http/URL.h>
#include <beast/module/asio/http/HTTPResponse.h> // DEPRECATED
#include <beast/module/asio/HTTPResponse.h> // DEPRECATED
#include <boost/regex.hpp>
#include <map>
#include <memory>