rippled
ripple
server
Handoff.h
1
//------------------------------------------------------------------------------
2
/*
3
This file is part of rippled: https://github.com/ripple/rippled
4
Copyright (c) 2012, 2013 Ripple Labs Inc.
5
6
Permission to use, copy, modify, and/or distribute this software for any
7
purpose with or without fee is hereby granted, provided that the above
8
copyright notice and this permission notice appear in all copies.
9
10
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
*/
18
//==============================================================================
19
20
#ifndef RIPPLE_SERVER_HANDOFF_H_INCLUDED
21
#define RIPPLE_SERVER_HANDOFF_H_INCLUDED
22
23
#include <ripple/server/Writer.h>
24
#include <boost/beast/http/dynamic_body.hpp>
25
#include <boost/beast/http/message.hpp>
26
#include <
memory
>
27
28
namespace
ripple
{
29
30
using
http_request_type
=
31
boost::beast::http::request<boost::beast::http::dynamic_body>;
32
33
using
http_response_type
=
34
boost::beast::http::response<boost::beast::http::dynamic_body>;
35
37
struct
Handoff
38
{
39
// When `true`, the Session will close the socket. The
40
// Handler may optionally take socket ownership using std::move
41
bool
moved
=
false
;
42
43
// If response is set, this determines the keep alive
44
bool
keep_alive
=
false
;
45
46
// When set, this will be sent back
47
std::shared_ptr<Writer>
response
;
48
49
bool
50
handled
()
const
51
{
52
return
moved
||
response
;
53
}
54
};
55
56
}
// namespace ripple
57
58
#endif
std::shared_ptr
STL class.
ripple::Handoff::moved
bool moved
Definition:
Handoff.h:41
memory
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition:
RCLCensorshipDetector.h:29
ripple::Handoff::handled
bool handled() const
Definition:
Handoff.h:50
ripple::Handoff
Used to indicate the result of a server connection handoff.
Definition:
Handoff.h:37
ripple::Handoff::response
std::shared_ptr< Writer > response
Definition:
Handoff.h:47
ripple::http_request_type
boost::beast::http::request< boost::beast::http::dynamic_body > http_request_type
Definition:
Handshake.h:47
ripple::http_response_type
boost::beast::http::response< boost::beast::http::dynamic_body > http_response_type
Definition:
Handshake.h:49
ripple::Handoff::keep_alive
bool keep_alive
Definition:
Handoff.h:44
Generated by
1.8.17