mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Inject Config:
* Use dependency injections instead * Remove deprecated fee interfaces
This commit is contained in:
committed by
Vinnie Falco
parent
c7b3153958
commit
fa796a2eb5
@@ -119,6 +119,8 @@ private:
|
||||
|
||||
handler_type& m_handler;
|
||||
weak_connection_ptr m_connection;
|
||||
|
||||
int pingFreq_;
|
||||
};
|
||||
|
||||
template <class WebSocket>
|
||||
@@ -141,7 +143,10 @@ ConnectionImpl <WebSocket>::ConnectionImpl (
|
||||
, m_pingTimer (io_service)
|
||||
, m_handler (handler)
|
||||
, m_connection (cpConnection)
|
||||
, pingFreq_ (app.config ().WEBSOCKET_PING_FREQ)
|
||||
{
|
||||
// VFALCO Disabled since it might cause hangs
|
||||
pingFreq_ = 0;
|
||||
}
|
||||
|
||||
template <class WebSocket>
|
||||
|
||||
@@ -73,16 +73,13 @@ boost::asio::io_service::strand& WebSocket02::getStrand (Connection& con)
|
||||
template <>
|
||||
void ConnectionImpl <WebSocket02>::setPingTimer ()
|
||||
{
|
||||
auto freq = getConfig ().WEBSOCKET_PING_FREQ;
|
||||
// VFALCO Disabled since it might cause hangs
|
||||
freq = 0;
|
||||
if (freq <= 0)
|
||||
if (pingFreq_ <= 0)
|
||||
return;
|
||||
connection_ptr ptr = m_connection.lock ();
|
||||
|
||||
if (ptr)
|
||||
{
|
||||
this->m_pingTimer.expires_from_now (boost::posix_time::seconds (freq));
|
||||
this->m_pingTimer.expires_from_now (
|
||||
boost::posix_time::seconds (pingFreq_));
|
||||
|
||||
this->m_pingTimer.async_wait (
|
||||
ptr->get_strand ().wrap (
|
||||
|
||||
@@ -115,14 +115,11 @@ EndpointPtr04 WebSocket04::makeEndpoint (HandlerPtr&& handler)
|
||||
template <>
|
||||
void ConnectionImpl <WebSocket04>::setPingTimer ()
|
||||
{
|
||||
auto freq = getConfig ().WEBSOCKET_PING_FREQ;
|
||||
// VFALCO Disabled since it might cause hangs
|
||||
freq = 0;
|
||||
if (freq <= 0)
|
||||
if (pingFreq_ <= 0)
|
||||
return;
|
||||
if (auto con = m_connection.lock ())
|
||||
{
|
||||
auto t = boost::posix_time::seconds (freq);
|
||||
auto t = boost::posix_time::seconds (pingFreq_);
|
||||
auto ms = t.total_milliseconds();
|
||||
con->set_timer (
|
||||
ms,
|
||||
|
||||
Reference in New Issue
Block a user