mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-19 10:35:50 +00:00
Per XLS-0095, we are taking steps to rename ripple(d) to xrpl(d). This change specifically removes all copyright notices referencing Ripple, XRPLF, and certain affiliated contributors upon mutual agreement, so the notice in the LICENSE.md file applies throughout. Copyright notices referencing external contributions remain as-is. Duplicate verbiage is also removed.
42 lines
940 B
C++
42 lines
940 B
C++
#ifndef XRPL_SERVER_HANDOFF_H_INCLUDED
|
|
#define XRPL_SERVER_HANDOFF_H_INCLUDED
|
|
|
|
#include <xrpl/server/Writer.h>
|
|
|
|
#include <boost/beast/http/dynamic_body.hpp>
|
|
#include <boost/beast/http/message.hpp>
|
|
|
|
#include <memory>
|
|
|
|
namespace ripple {
|
|
|
|
using http_request_type =
|
|
boost::beast::http::request<boost::beast::http::dynamic_body>;
|
|
|
|
using http_response_type =
|
|
boost::beast::http::response<boost::beast::http::dynamic_body>;
|
|
|
|
/** Used to indicate the result of a server connection handoff. */
|
|
struct Handoff
|
|
{
|
|
// When `true`, the Session will close the socket. The
|
|
// Handler may optionally take socket ownership using std::move
|
|
bool moved = false;
|
|
|
|
// If response is set, this determines the keep alive
|
|
bool keep_alive = false;
|
|
|
|
// When set, this will be sent back
|
|
std::shared_ptr<Writer> response;
|
|
|
|
bool
|
|
handled() const
|
|
{
|
|
return moved || response;
|
|
}
|
|
};
|
|
|
|
} // namespace ripple
|
|
|
|
#endif
|