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