mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-20 03:35:55 +00:00
Add missing call to dosGuard_.add
This commit is contained in:
@@ -155,18 +155,23 @@ public:
|
||||
}
|
||||
|
||||
void
|
||||
send(std::string const& msg)
|
||||
send(std::string&& msg)
|
||||
{
|
||||
size_t left = 0;
|
||||
{
|
||||
std::lock_guard<std::mutex> lck(mtx_);
|
||||
messages_.push(msg);
|
||||
messages_.push(std::move(msg));
|
||||
left = messages_.size();
|
||||
}
|
||||
// if the queue was previously empty, start the send chain
|
||||
if (left == 1)
|
||||
sendNext();
|
||||
}
|
||||
void
|
||||
send(std::string const& msg)
|
||||
{
|
||||
send({msg});
|
||||
}
|
||||
|
||||
void
|
||||
run(http::request<http::string_body> req)
|
||||
@@ -296,7 +301,9 @@ public:
|
||||
BOOST_LOG_TRIVIAL(trace)
|
||||
<< __func__ << " : " << boost::json::serialize(response);
|
||||
|
||||
send(boost::json::serialize(response));
|
||||
std::string responseStr = boost::json::serialize(response);
|
||||
dosGuard_.add(ip, responseStr.size());
|
||||
send(std::move(responseStr));
|
||||
do_read();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user