Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Integrate new webserver #1722

Merged
merged 89 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
9702b10
WIP: writing server
kuznetsss Aug 15, 2024
a7a7060
WIP: writing server
kuznetsss Aug 15, 2024
c03eecb
WIP: writing server
kuznetsss Aug 16, 2024
14f46c4
Add id for Connection
kuznetsss Aug 19, 2024
83cd970
WIP
kuznetsss Aug 19, 2024
e67804b
Improve Server building
kuznetsss Aug 20, 2024
bbb9d42
Separate creating acceptor
kuznetsss Aug 20, 2024
e8d04c2
WIP: writing server
kuznetsss Aug 20, 2024
ba9176b
Fix build, finish new connection handling
kuznetsss Aug 23, 2024
a6137e8
Small improvements
kuznetsss Aug 23, 2024
1910535
Implement HttpConnection (except upgrade)
kuznetsss Aug 27, 2024
3b0e40f
WIP: Implementing WsConnection
kuznetsss Aug 28, 2024
7313707
Move withTimeout to a separate util
kuznetsss Aug 30, 2024
e405242
Fix Connection constructor
kuznetsss Sep 23, 2024
2a6b104
Fix connection upgrade
kuznetsss Sep 23, 2024
a8e2ac4
Implementing WsConnection
kuznetsss Sep 24, 2024
8c15238
Finish implementing WsConnection
kuznetsss Sep 25, 2024
a43337d
Add tags to connections
kuznetsss Sep 26, 2024
e602733
WIP: Implementing ConnectionHandler
kuznetsss Sep 27, 2024
f924bc1
Implemented message handling
kuznetsss Sep 30, 2024
dd8a473
Add multiple processing strategies
kuznetsss Sep 30, 2024
ac8503a
Removed DosGuard and AdminVerificationStrategy from Server
kuznetsss Sep 30, 2024
4f916f3
Implemented Request and Response
kuznetsss Oct 1, 2024
55416ee
Fix compilation
kuznetsss Oct 2, 2024
372f96f
Merge branch 'develop' into 919_Refactor_webserver
kuznetsss Oct 2, 2024
6fc5d01
Bring changes from develop
kuznetsss Oct 2, 2024
6dcfbbd
Add tests for withTimeout
kuznetsss Oct 2, 2024
05c5e16
Add tests for AdminVerificationStrategy
kuznetsss Oct 2, 2024
2d34b28
Add tests for ServerSslContext
kuznetsss Oct 3, 2024
84c7a18
Cover Request with tests
kuznetsss Oct 7, 2024
9a2c82a
Covered Response with tests
kuznetsss Oct 7, 2024
a17d1db
WIP: Writing tests for HttpConnection
kuznetsss Oct 8, 2024
7508e42
Writing HttpConnection test
kuznetsss Oct 9, 2024
5026c49
Finish HttpConnection tests
kuznetsss Oct 11, 2024
07b2f85
Add tests for WsConnection
kuznetsss Oct 11, 2024
c6223a4
Writing tests for ConnectionHandler
kuznetsss Oct 14, 2024
53ccc66
WIP
kuznetsss Oct 15, 2024
eb98537
Add CoroutineGroup
kuznetsss Oct 16, 2024
0c9cb3f
Use CoroutineGroup in ConnectionHandler
kuznetsss Oct 16, 2024
5fd082d
Move tasks limit to CoroutineGroup
kuznetsss Oct 16, 2024
6194741
Add tests for make_Server
kuznetsss Oct 17, 2024
f6b2a13
Cover Server with tests. Fix some bugs
kuznetsss Oct 18, 2024
ad87096
Merge branch 'develop' into 919_Refactor_webserver
kuznetsss Oct 21, 2024
35a917f
Add documentation
kuznetsss Oct 21, 2024
e654718
Add more documentation
kuznetsss Oct 21, 2024
0b2abe6
Removed and_then and or_else ;-(
kuznetsss Oct 21, 2024
633707a
Remove redundant std::move's
kuznetsss Oct 21, 2024
81a4fff
Remove test data from artifacts
kuznetsss Oct 22, 2024
9a832fd
Merge remote-tracking branch 'upstream/develop' into 919_Refactor_web…
kuznetsss Oct 22, 2024
bc17152
Improving test coverage
kuznetsss Oct 22, 2024
8394b3b
Fix review issues
kuznetsss Oct 23, 2024
333ed86
Make doxygen happy
kuznetsss Oct 23, 2024
1fe4305
Merge remote-tracking branch 'upstream/develop' into 919_Refactor_web…
kuznetsss Oct 23, 2024
a7a40d4
Fix naming in comment
kuznetsss Oct 23, 2024
49503f5
Add --ng-web-server flag
kuznetsss Oct 23, 2024
4de29da
Add Prometheus handler with new web server
kuznetsss Oct 24, 2024
1844f66
Merge run methods
kuznetsss Oct 24, 2024
a4769ef
Add ng ErrorHandling
kuznetsss Oct 25, 2024
71afb53
Add ErrorHandling tests
kuznetsss Oct 25, 2024
e217401
Add tests for ng::ErrorHandling
kuznetsss Oct 28, 2024
c4ec64f
WIP: Refactoring ng::RPCServerHandler
kuznetsss Oct 28, 2024
af5a433
Add foreign coroutine support for CoroutineGroup
kuznetsss Oct 29, 2024
70ad7c8
Fix typo
kuznetsss Oct 29, 2024
3431bae
Add isAdmin to Connection
kuznetsss Oct 29, 2024
cbe715d
Fix potential data race
kuznetsss Oct 29, 2024
98390b8
Make connection's coroutine sleep while processing request
kuznetsss Oct 29, 2024
56e59a6
WIP: Add SubscriptionContextInterface
kuznetsss Oct 29, 2024
0bcecc8
Add SubscriptionContext
kuznetsss Oct 30, 2024
abdede4
Fixed tests
kuznetsss Oct 31, 2024
9cbc59e
Merge branch 'develop' into 919_Integrate_webserver
kuznetsss Nov 1, 2024
ed78cf5
Add tests for SubscriptionContext
kuznetsss Nov 1, 2024
262246b
Add tag factory to ConnectionHandler
kuznetsss Nov 4, 2024
34b1827
Add SubscriptionContext for ng
kuznetsss Nov 5, 2024
480e582
Add tests for ng::SubscriptionContext
kuznetsss Nov 6, 2024
0614751
Add sending queue limit
kuznetsss Nov 7, 2024
8eb72da
Create composeError() method in ErrorHelper
kuznetsss Nov 8, 2024
67ed522
Make ng RPCServerHandler compatible with other code
kuznetsss Nov 8, 2024
6e83473
Connect ng web server to Clio
kuznetsss Nov 8, 2024
042de41
Add httpHeaders method to Request
kuznetsss Nov 8, 2024
a5b1fad
Move AdminVerificationStrategy from impl
kuznetsss Nov 8, 2024
05a1f6a
Remove wrong serialize()
kuznetsss Nov 8, 2024
9bf6bb5
Merge remote-tracking branch 'upstream/develop' into 919_Integrate_we…
kuznetsss Nov 8, 2024
95f9c92
Fix docs
kuznetsss Nov 8, 2024
b3f55c1
Remove redundant std::move
kuznetsss Nov 8, 2024
75346ea
Merge remote-tracking branch 'upstream/develop' into 919_Integrate_we…
kuznetsss Nov 18, 2024
908b7e3
Fix review issues
kuznetsss Nov 18, 2024
27e9ed1
Fix missing disconnect
kuznetsss Nov 20, 2024
98371a2
Add tests for RPCServerHandler
kuznetsss Nov 20, 2024
a9b55f6
Merge branch 'develop' into 919_Integrate_webserver
kuznetsss Nov 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/examples/config/example-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@
// send a reply for each request whenever it is ready.
"parallel_requests_limit": 10, // Optional parameter, used only if "processing_strategy" is "parallel". It limits the number of requests for one client connection processed in parallel. Infinite if not specified.
// Max number of responses to queue up before sent successfully. If a client's waiting queue is too long, the server will close the connection.
"ws_max_sending_queue_size": 1500
"ws_max_sending_queue_size": 1500,
"__ng_web_server": false // Use ng web server. This is a temporary setting which will be deleted after switching to ng web server
},
// Time in seconds for graceful shutdown. Defaults to 10 seconds. Not fully implemented yet.
"graceful_period": 10.0,
Expand Down
4 changes: 3 additions & 1 deletion src/app/CliArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ CliArgs::parse(int argc, char const* argv[])
("help,h", "print help message and exit")
("version,v", "print version and exit")
("conf,c", po::value<std::string>()->default_value(defaultConfigPath), "configuration file")
("ng-web-server,w", "Use ng-web-server")
;
// clang-format on
po::positional_options_description positional;
Expand All @@ -64,7 +65,8 @@ CliArgs::parse(int argc, char const* argv[])
}

auto configPath = parsed["conf"].as<std::string>();
return Action{Action::Run{std::move(configPath)}};
return Action{Action::Run{.configPath = std::move(configPath), .useNgWebServer = parsed.count("ng-web-server") != 0}
};
}

} // namespace app
7 changes: 3 additions & 4 deletions src/app/CliArgs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,13 @@ class CliArgs {
public:
/** @brief Run action. */
struct Run {
/** @brief Configuration file path. */
std::string configPath;
std::string configPath; ///< Configuration file path.
bool useNgWebServer; ///< Whether to use a ng web server
};

/** @brief Exit action. */
struct Exit {
/** @brief Exit code. */
int exitCode;
int exitCode; ///< Exit code.
};

/**
Expand Down
98 changes: 97 additions & 1 deletion src/app/ClioApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,39 @@
#include "etl/NetworkValidatedLedgers.hpp"
#include "feed/SubscriptionManager.hpp"
#include "rpc/Counters.hpp"
#include "rpc/Errors.hpp"
#include "rpc/RPCEngine.hpp"
#include "rpc/WorkQueue.hpp"
#include "rpc/common/impl/HandlerProvider.hpp"
#include "util/Assert.hpp"
#include "util/build/Build.hpp"
#include "util/config/Config.hpp"
#include "util/log/Logger.hpp"
#include "util/prometheus/Http.hpp"
#include "util/prometheus/Prometheus.hpp"
#include "web/AdminVerificationStrategy.hpp"
#include "web/RPCServerHandler.hpp"
#include "web/Server.hpp"
#include "web/SubscriptionContextInterface.hpp"
#include "web/dosguard/DOSGuard.hpp"
#include "web/dosguard/IntervalSweepHandler.hpp"
#include "web/dosguard/WhitelistHandler.hpp"
#include "web/ng/Connection.hpp"
#include "web/ng/RPCServerHandler.hpp"
#include "web/ng/Request.hpp"
#include "web/ng/Response.hpp"
#include "web/ng/Server.hpp"

#include <boost/asio/io_context.hpp>
#include <boost/asio/spawn.hpp>
#include <boost/beast/http/status.hpp>

#include <cstdint>
#include <cstdlib>
#include <exception>
#include <memory>
#include <thread>
#include <utility>
#include <vector>

namespace app {
Expand Down Expand Up @@ -79,7 +93,7 @@
}

int
ClioApplication::run()
ClioApplication::run(bool const useNgWebServer)

Check warning on line 96 in src/app/ClioApplication.cpp

View check run for this annotation

Codecov / codecov/patch

src/app/ClioApplication.cpp#L96

Added line #L96 was not covered by tests
{
auto const threads = config_.valueOr("io_threads", 2);
if (threads <= 0) {
Expand Down Expand Up @@ -126,9 +140,91 @@
auto const rpcEngine =
RPCEngineType::make_RPCEngine(config_, backend, balancer, dosGuard, workQueue, counters, handlerProvider);

if (useNgWebServer or config_.valueOr("server.__ng_web_server", false)) {
web::ng::RPCServerHandler<RPCEngineType, etl::ETLService> handler{config_, backend, rpcEngine, etl};

auto expectedAdminVerifier = web::make_AdminVerificationStrategy(config_);
if (not expectedAdminVerifier.has_value()) {
LOG(util::LogService::error()) << "Error creating admin verifier: " << expectedAdminVerifier.error();
return EXIT_FAILURE;

Check warning on line 149 in src/app/ClioApplication.cpp

View check run for this annotation

Codecov / codecov/patch

src/app/ClioApplication.cpp#L149

Added line #L149 was not covered by tests
}
auto const adminVerifier = std::move(expectedAdminVerifier).value();

auto httpServer = web::ng::make_Server(config_, ioc);

if (not httpServer.has_value()) {
LOG(util::LogService::error()) << "Error creating web server: " << httpServer.error();
return EXIT_FAILURE;

Check warning on line 157 in src/app/ClioApplication.cpp

View check run for this annotation

Codecov / codecov/patch

src/app/ClioApplication.cpp#L157

Added line #L157 was not covered by tests
}

httpServer->onGet(
"/metrics",
[adminVerifier](

Check warning on line 162 in src/app/ClioApplication.cpp

View check run for this annotation

Codecov / codecov/patch

src/app/ClioApplication.cpp#L162

Added line #L162 was not covered by tests
web::ng::Request const& request,
web::ng::ConnectionMetadata& connectionMetadata,
web::SubscriptionContextPtr,
boost::asio::yield_context
) -> web::ng::Response {
auto const maybeHttpRequest = request.asHttpRequest();
ASSERT(maybeHttpRequest.has_value(), "Got not a http request in Get");
auto const& httpRequest = maybeHttpRequest->get();

Check warning on line 170 in src/app/ClioApplication.cpp

View check run for this annotation

Codecov / codecov/patch

src/app/ClioApplication.cpp#L170

Added line #L170 was not covered by tests

// FIXME(#1702): Using veb server thread to handle prometheus request. Better to post on work queue.
auto maybeResponse = util::prometheus::handlePrometheusRequest(
httpRequest, adminVerifier->isAdmin(httpRequest, connectionMetadata.ip())
);
ASSERT(maybeResponse.has_value(), "Got unexpected request for Prometheus");
return web::ng::Response{std::move(maybeResponse).value(), request};
}

Check warning on line 178 in src/app/ClioApplication.cpp

View check run for this annotation

Codecov / codecov/patch

src/app/ClioApplication.cpp#L178

Added line #L178 was not covered by tests
);

util::Logger webServerLog{"WebServer"};
auto onRequest = [adminVerifier, &webServerLog, &handler](

Check warning on line 182 in src/app/ClioApplication.cpp

View check run for this annotation

Codecov / codecov/patch

src/app/ClioApplication.cpp#L182

Added line #L182 was not covered by tests
web::ng::Request const& request,
web::ng::ConnectionMetadata& connectionMetadata,
web::SubscriptionContextPtr subscriptionContext,
boost::asio::yield_context yield
) -> web::ng::Response {
LOG(webServerLog.info()) << connectionMetadata.tag()
<< "Received request from ip = " << connectionMetadata.ip()
<< " - posting to WorkQueue";

connectionMetadata.setIsAdmin([&adminVerifier, &request, &connectionMetadata]() {
return adminVerifier->isAdmin(request.httpHeaders(), connectionMetadata.ip());

Check warning on line 193 in src/app/ClioApplication.cpp

View check run for this annotation

Codecov / codecov/patch

src/app/ClioApplication.cpp#L193

Added line #L193 was not covered by tests
});

try {
return handler(request, connectionMetadata, std::move(subscriptionContext), yield);
} catch (std::exception const&) {
return web::ng::Response{
boost::beast::http::status::internal_server_error,
rpc::makeError(rpc::RippledError::rpcINTERNAL),
request
};
}
};

Check warning on line 205 in src/app/ClioApplication.cpp

View check run for this annotation

Codecov / codecov/patch

src/app/ClioApplication.cpp#L204-L205

Added lines #L204 - L205 were not covered by tests

httpServer->onPost("/", onRequest);
httpServer->onWs(onRequest);

auto const maybeError = httpServer->run();
if (maybeError.has_value()) {
LOG(util::LogService::error()) << "Error starting web server: " << *maybeError;
return EXIT_FAILURE;

Check warning on line 213 in src/app/ClioApplication.cpp

View check run for this annotation

Codecov / codecov/patch

src/app/ClioApplication.cpp#L213

Added line #L213 was not covered by tests
}

// Blocks until stopped.
// When stopped, shared_ptrs fall out of scope
// Calls destructors on all resources, and destructs in order
start(ioc, threads);

return EXIT_SUCCESS;
}

Check warning on line 222 in src/app/ClioApplication.cpp

View check run for this annotation

Codecov / codecov/patch

src/app/ClioApplication.cpp#L221-L222

Added lines #L221 - L222 were not covered by tests

// Init the web server
auto handler =
std::make_shared<web::RPCServerHandler<RPCEngineType, etl::ETLService>>(config_, backend, rpcEngine, etl);

auto const httpServer = web::make_HttpServer(config_, ioc, dosGuard, handler);

// Blocks until stopped.
Expand Down
4 changes: 3 additions & 1 deletion src/app/ClioApplication.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ class ClioApplication {
/**
* @brief Run the application
*
* @param useNgWebServer Whether to use the new web server
*
* @return exit code
*/
int
run();
run(bool useNgWebServer);
kuznetsss marked this conversation as resolved.
Show resolved Hide resolved
};

} // namespace app
5 changes: 3 additions & 2 deletions src/feed/Types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@

#pragma once

#include "web/interface/ConnectionBase.hpp"
#include "web/SubscriptionContextInterface.hpp"

#include <memory>

namespace feed {
using Subscriber = web::ConnectionBase;

using Subscriber = web::SubscriptionContextInterface;
using SubscriberPtr = Subscriber*;
using SubscriberSharedPtr = std::shared_ptr<Subscriber>;
kuznetsss marked this conversation as resolved.
Show resolved Hide resolved

Expand Down
6 changes: 2 additions & 4 deletions src/feed/impl/ProposedTransactionFeed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ ProposedTransactionFeed::sub(SubscriberSharedPtr const& subscriber)
if (added) {
LOG(logger_.info()) << subscriber->tag() << "Subscribed tx_proposed";
++subAllCount_.get();
subscriber->onDisconnect.connect([this](SubscriberPtr connection) { unsubInternal(connection); });
subscriber->onDisconnect([this](SubscriberPtr connection) { unsubInternal(connection); });
}
}

Expand All @@ -73,9 +73,7 @@ ProposedTransactionFeed::sub(ripple::AccountID const& account, SubscriberSharedP
if (added) {
LOG(logger_.info()) << subscriber->tag() << "Subscribed accounts_proposed " << account;
++subAccountCount_.get();
subscriber->onDisconnect.connect([this, account](SubscriberPtr connection) {
unsubInternal(account, connection);
});
subscriber->onDisconnect([this, account](SubscriberPtr connection) { unsubInternal(account, connection); });
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/feed/impl/SingleFeedBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ SingleFeedBase::sub(SubscriberSharedPtr const& subscriber)
if (added) {
LOG(logger_.info()) << subscriber->tag() << "Subscribed " << name_;
++subCount_.get();
subscriber->onDisconnect.connect([this](SubscriberPtr connectionDisconnecting) {
subscriber->onDisconnect([this](SubscriberPtr connectionDisconnecting) {
unsubInternal(connectionDisconnecting);
});
};
Expand Down
1 change: 1 addition & 0 deletions src/feed/impl/TrackableSignalMap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include <boost/signals2.hpp>

#include <concepts>
#include <cstddef>
#include <functional>
#include <memory>
Expand Down
22 changes: 10 additions & 12 deletions src/feed/impl/TransactionFeed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ namespace feed::impl {
void
TransactionFeed::TransactionSlot::operator()(AllVersionTransactionsType const& allVersionMsgs) const
{
if (auto connection = connectionWeakPtr.lock(); connection) {
if (auto connection = subscriptionContextWeakPtr.lock(); connection) {
// Check if this connection already sent
if (feed.get().notified_.contains(connection.get()))
return;

feed.get().notified_.insert(connection.get());

if (connection->apiSubVersion < 2u) {
if (connection->apiSubversion() < 2u) {
connection->send(allVersionMsgs[0]);
return;
}
Expand All @@ -75,7 +75,7 @@ TransactionFeed::sub(SubscriberSharedPtr const& subscriber)
if (added) {
LOG(logger_.info()) << subscriber->tag() << "Subscribed transactions";
++subAllCount_.get();
subscriber->onDisconnect.connect([this](SubscriberPtr connection) { unsubInternal(connection); });
subscriber->onDisconnect([this](SubscriberPtr connection) { unsubInternal(connection); });
}
}

Expand All @@ -86,18 +86,16 @@ TransactionFeed::sub(ripple::AccountID const& account, SubscriberSharedPtr const
if (added) {
LOG(logger_.info()) << subscriber->tag() << "Subscribed account " << account;
++subAccountCount_.get();
subscriber->onDisconnect.connect([this, account](SubscriberPtr connection) {
unsubInternal(account, connection);
});
subscriber->onDisconnect([this, account](SubscriberPtr connection) { unsubInternal(account, connection); });
}
}

void
TransactionFeed::subProposed(SubscriberSharedPtr const& subscriber)
{
auto const added = txProposedsignal_.connectTrackableSlot(subscriber, TransactionSlot(*this, subscriber));
auto const added = txProposedSignal_.connectTrackableSlot(subscriber, TransactionSlot(*this, subscriber));
if (added) {
subscriber->onDisconnect.connect([this](SubscriberPtr connection) { unsubProposedInternal(connection); });
subscriber->onDisconnect([this](SubscriberPtr connection) { unsubProposedInternal(connection); });
}
}

Expand All @@ -107,7 +105,7 @@ TransactionFeed::subProposed(ripple::AccountID const& account, SubscriberSharedP
auto const added =
accountProposedSignal_.connectTrackableSlot(subscriber, account, TransactionSlot(*this, subscriber));
if (added) {
subscriber->onDisconnect.connect([this, account](SubscriberPtr connection) {
subscriber->onDisconnect([this, account](SubscriberPtr connection) {
unsubProposedInternal(account, connection);
});
}
Expand All @@ -120,7 +118,7 @@ TransactionFeed::sub(ripple::Book const& book, SubscriberSharedPtr const& subscr
if (added) {
LOG(logger_.info()) << subscriber->tag() << "Subscribed book " << book;
++subBookCount_.get();
subscriber->onDisconnect.connect([this, book](SubscriberPtr connection) { unsubInternal(book, connection); });
subscriber->onDisconnect([this, book](SubscriberPtr connection) { unsubInternal(book, connection); });
}
}

Expand Down Expand Up @@ -285,7 +283,7 @@ TransactionFeed::pub(
// clear the notified set. If the same connection subscribes both transactions + proposed_transactions,
// rippled SENDS the same message twice
notified_.clear();
txProposedsignal_.emit(allVersionsMsgs);
txProposedSignal_.emit(allVersionsMsgs);
notified_.clear();
// check duplicate for account and proposed_account, this prevents sending the same message multiple times
// if it affects multiple accounts watched by the same connection
Expand Down Expand Up @@ -323,7 +321,7 @@ TransactionFeed::unsubInternal(ripple::AccountID const& account, SubscriberPtr s
void
TransactionFeed::unsubProposedInternal(SubscriberPtr subscriber)
{
txProposedsignal_.disconnect(subscriber);
txProposedSignal_.disconnect(subscriber);
}

void
Expand Down
6 changes: 3 additions & 3 deletions src/feed/impl/TransactionFeed.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ class TransactionFeed {

struct TransactionSlot {
std::reference_wrapper<TransactionFeed> feed;
std::weak_ptr<Subscriber> connectionWeakPtr;
std::weak_ptr<Subscriber> subscriptionContextWeakPtr;

TransactionSlot(TransactionFeed& feed, SubscriberSharedPtr const& connection)
: feed(feed), connectionWeakPtr(connection)
: feed(feed), subscriptionContextWeakPtr(connection)
{
}

Expand All @@ -76,7 +76,7 @@ class TransactionFeed {

// Signals for proposed tx subscribers
TrackableSignalMap<ripple::AccountID, Subscriber, AllVersionTransactionsType const&> accountProposedSignal_;
TrackableSignal<Subscriber, AllVersionTransactionsType const&> txProposedsignal_;
TrackableSignal<Subscriber, AllVersionTransactionsType const&> txProposedSignal_;

std::unordered_set<SubscriberPtr>
notified_; // Used by slots to prevent double notifications if tx contains multiple subscribed accounts
Expand Down
3 changes: 2 additions & 1 deletion src/main/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ try {
}
util::LogService::init(config);
app::ClioApplication clio{config};
return clio.run();

return clio.run(run.useNgWebServer);
}
);
} catch (std::exception const& e) {
Expand Down
Loading
Loading