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