Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
web::impl::HttpBase< Derived, HandlerType > Class Template Reference

This is the implementation class for http sessions. More...

#include <HttpBase.hpp>

Inheritance diagram for web::impl::HttpBase< Derived, HandlerType >:
Collaboration diagram for web::impl::HttpBase< Derived, HandlerType >:

Public Member Functions

 HttpBase (std::string const &ip, std::reference_wrapper< util::TagDecoratorFactory const > tagFactory, std::shared_ptr< AdminVerificationStrategy > adminVerification, std::reference_wrapper< dosguard::DOSGuardInterface > dosGuard, std::shared_ptr< HandlerType > handler, boost::beast::flat_buffer buffer)
 
void doRead ()
 
void onRead (boost::beast::error_code ec, std::size_t bytesTransferred)
 
void send (std::string &&msg, http::status status=http::status::ok) override
 Send a response to the client The message length will be added to the DOSGuard, if the limit is reached, a warning will be added to the response.
 
SubscriptionContextPtr makeSubscriptionContext (util::TagDecoratorFactory const &) override
 Get the subscription context for this connection.
 
void onWrite (bool close, boost::beast::error_code ec, std::size_t bytesTransferred)
 
- Public Member Functions inherited from web::ConnectionBase
 ConnectionBase (util::TagDecoratorFactory const &tagFactory, std::string ip)
 Create a new connection base.
 
virtual void send (std::shared_ptr< std::string > msg)
 Send via shared_ptr of string, that enables SubscriptionManager to publish to clients.
 
bool dead ()
 Indicates whether the connection had an error and is considered dead.
 
bool isAdmin () const
 Indicates whether the connection has admin privileges.
 
- Public Member Functions inherited from util::Taggable
 Taggable (Taggable &&)=default
 
Taggableoperator= (Taggable &&)=default
 
BaseTagDecorator const & tag () const
 Getter for tag decorator.
 

Protected Member Functions

void httpFail (boost::beast::error_code ec, char const *what)
 
- Protected Member Functions inherited from util::Taggable
 Taggable (util::TagDecoratorFactory const &tagFactory)
 New Taggable from a specified factory.
 

Protected Attributes

boost::beast::flat_buffer buffer_
 
http::request< http::string_body > req_
 
std::reference_wrapper< dosguard::DOSGuardInterfacedosGuard_
 
std::shared_ptr< HandlerType > const handler_
 
util::Logger log_ {"WebServer"}
 
util::Logger perfLog_ {"Performance"}
 
- Protected Attributes inherited from web::ConnectionBase
boost::system::error_code ec_
 
bool isAdmin_ = false
 

Additional Inherited Members

- Public Attributes inherited from web::ConnectionBase
std::string const clientIp
 
bool upgraded = false
 

Detailed Description

template<template< typename > typename Derived, SomeServerHandler HandlerType>
class web::impl::HttpBase< Derived, HandlerType >

This is the implementation class for http sessions.

Template Parameters
DerivedThe derived class
HandlerTypeThe handler class, will be called when a request is received.

Member Function Documentation

◆ makeSubscriptionContext()

template<template< typename > typename Derived, SomeServerHandler HandlerType>
SubscriptionContextPtr web::impl::HttpBase< Derived, HandlerType >::makeSubscriptionContext ( util::TagDecoratorFactory const & factory)
inlineoverridevirtual

Get the subscription context for this connection.

Parameters
factoryTag TagDecoratorFactory to use to create the context.
Returns
The subscription context for this connection.

Implements web::ConnectionBase.

◆ send()

template<template< typename > typename Derived, SomeServerHandler HandlerType>
void web::impl::HttpBase< Derived, HandlerType >::send ( std::string && msg,
http::status status = http::status::ok )
inlineoverridevirtual

Send a response to the client The message length will be added to the DOSGuard, if the limit is reached, a warning will be added to the response.

Implements web::ConnectionBase.


The documentation for this class was generated from the following file: