xrpld
Loading...
Searching...
No Matches
Handoff.h
1#pragma once
2
3#include <xrpl/server/Writer.h>
4
5#include <boost/beast/http/dynamic_body.hpp>
6#include <boost/beast/http/message.hpp>
7
8#include <memory>
9
10namespace xrpl {
11
12using http_request_type = boost::beast::http::request<boost::beast::http::dynamic_body>;
13
14using http_response_type = boost::beast::http::response<boost::beast::http::dynamic_body>;
15
19struct Handoff
20{
21 // When `true`, the Session will close the socket. The
22 // Handler may optionally take socket ownership using std::move
23 bool moved = false;
24
25 // If response is set, this determines the keep alive
26 bool keepAlive = false;
27
28 // When set, this will be sent back
30
31 [[nodiscard]] bool
32 handled() const
33 {
34 return moved || response;
35 }
36};
37
38} // namespace xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
boost::beast::http::request< boost::beast::http::dynamic_body > http_request_type
Definition Handoff.h:12
boost::beast::http::response< boost::beast::http::dynamic_body > http_response_type
Definition Handoff.h:14
Used to indicate the result of a server connection handoff.
Definition Handoff.h:20
bool keepAlive
Definition Handoff.h:26
std::shared_ptr< Writer > response
Definition Handoff.h:29
bool handled() const
Definition Handoff.h:32