rippled
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
17struct Handoff
18{
19 // When `true`, the Session will close the socket. The
20 // Handler may optionally take socket ownership using std::move
21 bool moved = false;
22
23 // If response is set, this determines the keep alive
24 bool keep_alive = false;
25
26 // When set, this will be sent back
28
29 bool
30 handled() const
31 {
32 return moved || response;
33 }
34};
35
36} // namespace xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
boost::beast::http::response< boost::beast::http::dynamic_body > http_response_type
Definition Handoff.h:14
boost::beast::http::request< boost::beast::http::dynamic_body > http_request_type
Definition Handoff.h:12
Used to indicate the result of a server connection handoff.
Definition Handoff.h:18
std::shared_ptr< Writer > response
Definition Handoff.h:27
bool keep_alive
Definition Handoff.h:24
bool handled() const
Definition Handoff.h:30