mirror of
https://github.com/XRPLF/clio.git
synced 2026-08-22 05:00:52 +00:00
feat: Integrate new webserver (#1722)
For #919. The new web server is not using dosguard yet. It will be fixed by a separate PR.
This commit is contained in:
@@ -20,13 +20,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "util/Taggable.hpp"
|
||||
#include "web/SubscriptionContextInterface.hpp"
|
||||
|
||||
#include <boost/beast/http.hpp>
|
||||
#include <boost/beast/http/status.hpp>
|
||||
#include <boost/signals2.hpp>
|
||||
#include <boost/signals2/variadic_signal.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
@@ -49,13 +49,6 @@ protected:
|
||||
public:
|
||||
std::string const clientIp;
|
||||
bool upgraded = false;
|
||||
boost::signals2::signal<void(ConnectionBase*)> onDisconnect;
|
||||
/**
|
||||
* @brief The API version of the web stream client.
|
||||
* This is used to track the api version of this connection, which mainly is used by subscription. It is different
|
||||
* from the api version in Context, which is only used for the current request.
|
||||
*/
|
||||
std::uint32_t apiSubVersion = 0;
|
||||
|
||||
/**
|
||||
* @brief Create a new connection base.
|
||||
@@ -68,11 +61,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
~ConnectionBase() override
|
||||
{
|
||||
onDisconnect(this);
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Send the response to the client.
|
||||
*
|
||||
@@ -94,6 +82,15 @@ public:
|
||||
throw std::logic_error("web server can not send the shared payload");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the subscription context for this connection.
|
||||
*
|
||||
* @param factory Tag TagDecoratorFactory to use to create the context.
|
||||
* @return The subscription context for this connection.
|
||||
*/
|
||||
virtual SubscriptionContextPtr
|
||||
makeSubscriptionContext(util::TagDecoratorFactory const& factory) = 0;
|
||||
|
||||
/**
|
||||
* @brief Indicates whether the connection had an error and is considered dead.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user