Refactor beast::asio:

* New tools for completion handlers:
  - wrap_handler provides composed io_service execution guarantees.
  - bind_handler rebinds arguments to handlers.
  - shared_handler type-erases any completion handler.
  - buffer_sequence type-erases templated BufferSequences
  - abstract_socket replaces Socket
  - socket_wrapper replaces SocketWrapper
  - beast::asio placeholders to work with std::bind

* Removed obsolete classes and functions
  - AbstractHandler
  - ComposedAsyncOperation
  - SharedFunction
  - SharedHandler
  - SharedHandlerAllocator
  - SharedHandlerPtr
  - SharedHandlerType
  - SocketBase
  - SocketWrapperStrand
  - wrapHandler

* Refactored classes to use new tools
  - abstract_socket
  - socket_wrapper
  - HandshakeDetector
  - HttpClientType

* Miscellanous tidying
  - socket classes moved to beast::asio namespace
  - beast asio files provide their own namespace declaration.
  - Fix IsCallPossible conflicting template parameter name
  - Use <boost/get_pointer.hpp> for C++11 compatibility.
  - Remove extraneous include path from build environment.
This commit is contained in:
Vinnie Falco
2014-03-07 20:06:12 -08:00
parent e3c1375f36
commit c2fd1215f5
161 changed files with 3141 additions and 3789 deletions

View File

@@ -39,12 +39,12 @@ struct Port
Port (Port const& other);
Port& operator= (Port const& other);
Port (uint16 port_, IP::Endpoint const& addr_,
Security security_, SSLContext* context_);
Security security_, beast::asio::SSLContext* context_);
uint16 port;
IP::Endpoint addr;
Security security;
SSLContext* context;
beast::asio::SSLContext* context;
};
bool operator== (Port const& lhs, Port const& rhs);

View File

@@ -26,7 +26,7 @@ namespace HTTP {
/** A listening socket. */
class Door
: public SharedObject
, public AsyncObject <Door>
, public beast::asio::AsyncObject <Door>
, public List <Door>::Node
, public LeakChecked <Door>
{

View File

@@ -28,12 +28,12 @@ namespace ripple {
namespace HTTP {
// Holds the copy of buffers being sent
typedef SharedArg <std::string> SharedBuffer;
typedef beast::asio::SharedArg <std::string> SharedBuffer;
/** Represents an active connection. */
class Peer
: public SharedObject
, public AsyncObject <Peer>
, public beast::asio::AsyncObject <Peer>
, public Session
, public List <Peer>::Node
, public LeakChecked <Peer>
@@ -229,8 +229,8 @@ public:
if (m_socket->needs_handshake ())
{
m_socket->async_handshake (Socket::server, m_strand.wrap (
boost::bind (&Peer::handle_handshake, Ptr(this),
m_socket->async_handshake (beast::asio::abstract_socket::server,
m_strand.wrap (boost::bind (&Peer::handle_handshake, Ptr(this),
boost::asio::placeholders::error,
CompletionCounter (this))));
}

View File

@@ -48,7 +48,7 @@ Port::Port (
uint16 port_,
IP::Endpoint const& addr_,
Security security_,
SSLContext* context_)
beast::asio::SSLContext* context_)
: port (port_)
, addr (addr_)
, security (security_)

View File

@@ -23,7 +23,7 @@
#include "../ripple_net/ripple_net.h"
#include "beast/modules/beast_core/system/BeforeBoost.h"
#include "../beast/modules/beast_core/system/BeforeBoost.h"
#include <boost/asio.hpp>
#include <boost/optional.hpp>

View File

@@ -20,11 +20,11 @@
#ifndef RIPPLE_HTTP_H_INCLUDED
#define RIPPLE_HTTP_H_INCLUDED
#include "beast/modules/beast_core/beast_core.h"
#include "../beast/modules/beast_core/beast_core.h"
// VFALCO NOTE this sucks that we have to include asio in the header
// just for HTTPMessage!!
#include "beast/modules/beast_asio/beast_asio.h"
#include "../beast/modules/beast_asio/beast_asio.h"
# include "api/Port.h"
# include "api/ScopedStream.h"