mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-29 23:45:51 +00:00
Roll back 7 commits
This commit is contained in:
@@ -22,13 +22,8 @@
|
||||
|
||||
// beast_basics flags
|
||||
|
||||
#define BEAST_USE_BOOST 1
|
||||
|
||||
// VFALCO TODO Fix this problem with FreeBSD and std::bind.
|
||||
// We need to enforce a minimum library/g++ version.
|
||||
//
|
||||
#if __FreeBSD__
|
||||
#define BEAST_BIND_USES_BOOST 1
|
||||
#ifndef BEAST_USE_BOOST
|
||||
#define BEAST_USE_BOOST 0
|
||||
#endif
|
||||
|
||||
#ifndef BEAST_USE_LEAKCHECKED
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_VARIADIC_MAX=10;_WIN32_WINNT=0x0600;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0600;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<AdditionalIncludeDirectories>$(RepoDir);$(RepoDir)\src\cpp\protobuf\src;$(RepoDir)\src\cpp\protobuf\vsprojects;$(RepoDir)\build\proto;$(RepoDir)\Subtrees;$(RepoDir)\Subtrees\leveldb;$(RepoDir)\Subtrees\leveldb\include;$(RepoDir)\Subtrees\beast;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
|
||||
@@ -222,12 +222,12 @@
|
||||
|
||||
@todo Discuss the treatment of exceptions versus Error objects in the library.
|
||||
|
||||
@todo Discuss the additions to BeastConfig.h
|
||||
@todo Discuss the additions to AppConfig.h
|
||||
|
||||
@defgroup beast_core beast_core
|
||||
*/
|
||||
|
||||
/* See the JUCE notes regarding BeastConfig.h
|
||||
/* See the Juce notes regarding AppConfig.h
|
||||
|
||||
This file must always be included before any Juce headers.
|
||||
|
||||
@@ -238,7 +238,7 @@
|
||||
/* BeastConfig.h must be included before this file */
|
||||
|
||||
/* Use sensible default configurations if they forgot
|
||||
to append the necessary macros into their BeastConfig.h.
|
||||
to append the necessary macros into their AppConfig.h.
|
||||
*/
|
||||
#ifndef BEAST_USE_BOOST
|
||||
#define BEAST_USE_BOOST 0
|
||||
@@ -286,57 +286,6 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// This is a hack to fix boost's goofy placeholders
|
||||
#if BEAST_USE_BOOST
|
||||
#ifdef BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
|
||||
#error <boost/bind.hpp> must not be included before this file
|
||||
#endif
|
||||
// Prevent <boost/bind/placeholders.hpp> from being included
|
||||
#define BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
|
||||
#include <boost/bind/arg.hpp>
|
||||
#include <boost/config.hpp>
|
||||
// This is from <boost/bind/placeholders.cpp>
|
||||
namespace boost {
|
||||
namespace placeholders {
|
||||
#if defined(__BORLANDC__) || defined(__GNUC__) && (__GNUC__ < 4)
|
||||
static inline boost::arg<1> _1() { return boost::arg<1>(); }
|
||||
static inline boost::arg<2> _2() { return boost::arg<2>(); }
|
||||
static inline boost::arg<3> _3() { return boost::arg<3>(); }
|
||||
static inline boost::arg<4> _4() { return boost::arg<4>(); }
|
||||
static inline boost::arg<5> _5() { return boost::arg<5>(); }
|
||||
static inline boost::arg<6> _6() { return boost::arg<6>(); }
|
||||
static inline boost::arg<7> _7() { return boost::arg<7>(); }
|
||||
static inline boost::arg<8> _8() { return boost::arg<8>(); }
|
||||
static inline boost::arg<9> _9() { return boost::arg<9>(); }
|
||||
#elif defined(BOOST_MSVC) || (defined(__DECCXX_VER) && __DECCXX_VER <= 60590031) || defined(__MWERKS__) || \
|
||||
defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ < 2)
|
||||
static boost::arg<1> _1;
|
||||
static boost::arg<2> _2;
|
||||
static boost::arg<3> _3;
|
||||
static boost::arg<4> _4;
|
||||
static boost::arg<5> _5;
|
||||
static boost::arg<6> _6;
|
||||
static boost::arg<7> _7;
|
||||
static boost::arg<8> _8;
|
||||
static boost::arg<9> _9;
|
||||
#else
|
||||
boost::arg<1> _1;
|
||||
boost::arg<2> _2;
|
||||
boost::arg<3> _3;
|
||||
boost::arg<4> _4;
|
||||
boost::arg<5> _5;
|
||||
boost::arg<6> _6;
|
||||
boost::arg<7> _7;
|
||||
boost::arg<8> _8;
|
||||
boost::arg<9> _9;
|
||||
#endif
|
||||
}
|
||||
using namespace placeholders;
|
||||
}
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// Choose a source of bind, placeholders, and function
|
||||
|
||||
#if !BEAST_BIND_USES_STD && !BEAST_BIND_USES_TR1 && !BEAST_BIND_USES_BOOST
|
||||
|
||||
@@ -20,17 +20,7 @@
|
||||
#ifndef BEAST_BIND_BEASTHEADER
|
||||
#define BEAST_BIND_BEASTHEADER
|
||||
|
||||
// VFALCO TODO Rename this file to beast_Functional.h
|
||||
|
||||
/* Brings functional support into our namespace, based on environment.
|
||||
|
||||
Notes on bind
|
||||
|
||||
Difference between boost::bind and std::bind
|
||||
http://stackoverflow.com/questions/10555566/is-there-any-difference-between-c11-stdbind-and-boostbind
|
||||
|
||||
Resolving conflict between boost::shared_ptr and std::shared_ptr
|
||||
http://stackoverflow.com/questions/4682343/how-to-resolve-conflict-between-boostshared-ptr-and-using-stdshared-ptr
|
||||
*/
|
||||
|
||||
#ifndef BEAST_BIND_PLACEHOLDERS_N
|
||||
@@ -58,7 +48,6 @@
|
||||
#if BEAST_BIND_USES_STD
|
||||
|
||||
using std::ref;
|
||||
using std::cref;
|
||||
using std::bind;
|
||||
using std::function;
|
||||
|
||||
@@ -147,7 +136,6 @@ using std::placeholders::_20;
|
||||
#elif BEAST_BIND_USES_TR1
|
||||
|
||||
using std::tr1::ref;
|
||||
using std::tr1::cref;
|
||||
using std::tr1::bind;
|
||||
using std::tr1::function;
|
||||
|
||||
@@ -236,7 +224,6 @@ using std::tr1::placeholders::_20;
|
||||
#elif BEAST_BIND_USES_BOOST
|
||||
|
||||
using boost::ref;
|
||||
using boost::cref;
|
||||
using boost::bind;
|
||||
using boost::function;
|
||||
|
||||
|
||||
@@ -551,13 +551,10 @@ void server<endpoint>::connection<connection_type>::async_init() {
|
||||
m_connection.register_timeout(5000,fail::status::TIMEOUT_WS,
|
||||
"Timeout on WebSocket handshake");
|
||||
|
||||
static boost::arg<1> pl1;
|
||||
static boost::arg<2> pl2;
|
||||
|
||||
boost::shared_ptr<std::string> stringPtr = boost::make_shared<std::string>();
|
||||
m_connection.get_socket().async_read_until(
|
||||
m_connection.buffer(),
|
||||
boost::bind(&match_header, stringPtr, pl1, pl2),
|
||||
boost::bind(&match_header, stringPtr, _1, _2),
|
||||
m_connection.get_strand().wrap(boost::bind(
|
||||
&type::handle_read_request,
|
||||
m_connection.shared_from_this(),
|
||||
|
||||
9
TODO.txt
9
TODO.txt
@@ -2,13 +2,6 @@
|
||||
TODO
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
- Make beast::HashMap support assignment via operator[]
|
||||
- Rewrite TxFormats to use beast containers and RAII, and not leak
|
||||
- Add ICore interface
|
||||
- Make TxFormats a member of ICore instead of a singleton.
|
||||
|
||||
- Rename LoadMonitor to LoadMeter, change LoadEvent to LoadMeter::ScopedSample
|
||||
|
||||
- Fix all leaks on exit (!)
|
||||
|
||||
Say there's a leak, a ledger that can never be accessed is locked in some
|
||||
@@ -30,6 +23,8 @@ TODO
|
||||
|
||||
- Remove "ENABLE_INSECURE" when the time is right.
|
||||
|
||||
- lift bind, function, and placeholders into ripple namespace
|
||||
- lift beast into the ripple namespace, remove ripple's duplicated integer types
|
||||
- lift unique_ptr / auto_ptr into ripple namespace, or replace with ScopedPointer
|
||||
|
||||
- Make LevelDB and Ripple code work with both Unicode and non-Unicode Windows APIs
|
||||
|
||||
@@ -12,11 +12,6 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#include "BeastConfig.h"
|
||||
|
||||
// This must come first to work around the boost placeholders issues
|
||||
#include "modules/beast_basics/beast_basics.h"
|
||||
|
||||
// VFALCO NOTE Holy smokes...that's a lot of boost!!!
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
@@ -29,6 +24,7 @@
|
||||
#include <boost/bimap/list_of.hpp>
|
||||
#include <boost/bimap/multiset_of.hpp>
|
||||
#include <boost/bimap/unordered_set_of.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/date_time/posix_time/posix_time_types.hpp>
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
@@ -75,6 +71,8 @@
|
||||
|
||||
#include "../ripple_data/ripple_data.h"
|
||||
|
||||
|
||||
|
||||
#include "../modules/ripple_websocket/ripple_websocket.h"
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
@ingroup ripple_basics
|
||||
*/
|
||||
|
||||
#include "BeastConfig.h"
|
||||
|
||||
#include "ripple_basics.h"
|
||||
|
||||
// VFALCO TODO Rewrite Sustain to use beast::Process
|
||||
|
||||
@@ -22,35 +22,10 @@
|
||||
|
||||
#include "system/ripple_StandardIncludes.h"
|
||||
|
||||
// This must come before Boost, to fix the boost placeholders problem
|
||||
#include "modules/beast_basics/beast_basics.h"
|
||||
|
||||
#include "system/ripple_BoostIncludes.h"
|
||||
|
||||
#include "system/ripple_OpenSSLIncludes.h"
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// From
|
||||
// http://stackoverflow.com/questions/4682343/how-to-resolve-conflict-between-boostshared-ptr-and-using-stdshared-ptr
|
||||
//
|
||||
namespace boost
|
||||
{
|
||||
template <class T>
|
||||
const T* get_pointer (std::shared_ptr<T> const& ptr)
|
||||
{
|
||||
return ptr.get();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
T* get_pointer (std::shared_ptr<T>& ptr)
|
||||
{
|
||||
return ptr.get();
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// ByteOrder
|
||||
#ifdef WIN32
|
||||
// (nothing)
|
||||
@@ -62,8 +37,10 @@ namespace boost
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#include "BeastConfig.h" // Must come before any Beast includes
|
||||
|
||||
#include "modules/beast_core/beast_core.h"
|
||||
//#include "modules/beast_basics/beast_basics.h"
|
||||
#include "modules/beast_basics/beast_basics.h"
|
||||
|
||||
// VFALCO TODO Fix this for FreeBSD
|
||||
//#include "modules/beast_basics/beast_basics.h"
|
||||
@@ -73,7 +50,17 @@ namespace boost
|
||||
namespace ripple
|
||||
{
|
||||
|
||||
using namespace beast;
|
||||
// VFALCO TODO Make this work. We have to get rid of BIND_TYPE,
|
||||
// FUNC_TYPE, and P_* placeholders.
|
||||
//
|
||||
//using namespace beast;
|
||||
|
||||
using beast::int16;
|
||||
using beast::int32;
|
||||
using beast::int64;
|
||||
using beast::uint16;
|
||||
using beast::uint32;
|
||||
using beast::uint64;
|
||||
|
||||
#include "utility/ripple_Log.h" // Needed by others
|
||||
|
||||
|
||||
@@ -7,30 +7,36 @@
|
||||
#ifndef RIPPLE_PLATFORMMACROS_H
|
||||
#define RIPPLE_PLATFORMMACROS_H
|
||||
|
||||
#define FUNCTION_TYPE beast::function
|
||||
#define BIND_TYPE beast::bind
|
||||
#define P_1 beast::_1
|
||||
#define P_2 beast::_2
|
||||
#define P_3 beast::_3
|
||||
#define P_4 beast::_4
|
||||
|
||||
// VFALCO TODO Clean this up
|
||||
|
||||
#if (!defined(FORCE_NO_C11X) && (__cplusplus > 201100L)) || defined(FORCE_C11X)
|
||||
|
||||
// VFALCO TODO Get rid of the C11X macro
|
||||
// VFALCO TODO replace BIND_TYPE with a namespace lift
|
||||
|
||||
#define C11X
|
||||
#define UPTR_T std::unique_ptr
|
||||
#define MOVE_P(p) std::move(p)
|
||||
#define BIND_TYPE std::bind
|
||||
#define FUNCTION_TYPE std::function
|
||||
#define P_1 std::placeholders::_1
|
||||
#define P_2 std::placeholders::_2
|
||||
#define P_3 std::placeholders::_3
|
||||
#define P_4 std::placeholders::_4
|
||||
|
||||
#else
|
||||
|
||||
#define UPTR_T std::auto_ptr
|
||||
#define MOVE_P(p) (p)
|
||||
#define BIND_TYPE boost::bind
|
||||
#define FUNCTION_TYPE boost::function
|
||||
#define P_1 _1
|
||||
#define P_2 _2
|
||||
#define P_3 _3
|
||||
#define P_4 _4
|
||||
|
||||
#endif
|
||||
|
||||
// VFALCO TODO Clean this stuff up. Remove as much as possible
|
||||
// VFALCO TODO Clean this junk up
|
||||
#define nothing() do {} while (0)
|
||||
#define fallthru() do {} while (0)
|
||||
#define NUMBER(x) (sizeof(x)/sizeof((x)[0]))
|
||||
|
||||
@@ -12,9 +12,6 @@ class JobQueue
|
||||
public:
|
||||
explicit JobQueue (boost::asio::io_service&);
|
||||
|
||||
// VFALCO TODO make convenience functions that allow the caller to not
|
||||
// have to call bind.
|
||||
//
|
||||
void addJob (JobType type, const std::string& name, const FUNCTION_TYPE<void (Job&)>& job);
|
||||
|
||||
int getJobCount (JobType t); // Jobs waiting at this priority
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
@ingroup ripple_core
|
||||
*/
|
||||
|
||||
#include "BeastConfig.h"
|
||||
|
||||
#include "ripple_core.h"
|
||||
|
||||
#include <fstream>
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
@ingroup ripple_data
|
||||
*/
|
||||
|
||||
#include "BeastConfig.h"
|
||||
|
||||
#include "ripple_data.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
@ingroup ripple_json
|
||||
*/
|
||||
|
||||
#include "BeastConfig.h"
|
||||
|
||||
#include "ripple_json.h"
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
|
||||
// Unity build file for LevelDB
|
||||
|
||||
#include "BeastConfig.h"
|
||||
|
||||
#include "ripple_leveldb.h"
|
||||
|
||||
#include "beast/modules/beast_core/system/beast_TargetPlatform.h"
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
@ingroup ripple_sqlite
|
||||
*/
|
||||
|
||||
#include "BeastConfig.h"
|
||||
|
||||
// This prevents sqlite.h from being included
|
||||
//
|
||||
#define RIPPLE_SQLITE_MODULE_INCLUDED 1
|
||||
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
mSocket->set_verify_mode (boost::asio::ssl::verify_peer);
|
||||
|
||||
// XXX Verify semantics of RFC 2818 are what we want.
|
||||
mSocket->set_verify_callback (boost::bind (&rfc2818_verify, strDomain, boost::placeholders::_1, boost::placeholders::_2), ec);
|
||||
mSocket->set_verify_callback (boost::bind (&rfc2818_verify, strDomain, _1, _2), ec);
|
||||
|
||||
return ec;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include "BeastConfig.h"
|
||||
|
||||
#ifndef __STDC_LIMIT_MACROS
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
@@ -66,7 +66,7 @@ extern void callRPC (
|
||||
const std::string& strUsername, const std::string& strPassword,
|
||||
const std::string& strPath, const std::string& strMethod,
|
||||
const Json::Value& jvParams, const bool bSSL,
|
||||
FUNCTION_TYPE<void (const Json::Value& jvInput)> callbackFuncP = FUNCTION_TYPE<void (const Json::Value& jvInput)> ());
|
||||
FUNCTION_TYPE<void (const Json::Value& jvInput)> callbackFuncP = 0);
|
||||
#endif
|
||||
|
||||
// vim:ts=4
|
||||
|
||||
@@ -306,7 +306,7 @@ bool LedgerMaster::acquireMissingLedger (Ledger::ref origLedger, uint256 const&
|
||||
if (mMissingLedger->setAccept ())
|
||||
{
|
||||
if (!mMissingLedger->addOnComplete (BIND_TYPE (&LedgerMaster::missingAcquireComplete, this, P_1)))
|
||||
theApp->getIOService ().post (BIND_TYPE (&LedgerMaster::missingAcquireComplete, this, mMissingLedger));
|
||||
theApp->getIOService ().post (boost::bind (&LedgerMaster::missingAcquireComplete, this, mMissingLedger));
|
||||
}
|
||||
|
||||
int fetchMax = theConfig.getSize (siLedgerFetch);
|
||||
|
||||
@@ -312,7 +312,7 @@ void NetworkOPs::runTransactionQueue ()
|
||||
}
|
||||
|
||||
if (theApp->getTxnQueue ().stopProcessing (txn))
|
||||
theApp->getIOService ().post (BIND_TYPE (&NetworkOPs::runTransactionQueue, this));
|
||||
theApp->getIOService ().post (boost::bind (&NetworkOPs::runTransactionQueue, this));
|
||||
}
|
||||
|
||||
Transaction::pointer NetworkOPs::processTransaction (Transaction::pointer trans, bool bAdmin, bool bFailHard, stCallback callback)
|
||||
@@ -2278,7 +2278,7 @@ void NetworkOPs::gotFetchPack (bool progress, uint32 seq)
|
||||
mLastFetchPack = 0;
|
||||
mFetchSeq = seq; // earliest pack we have data on
|
||||
theApp->getJobQueue ().addJob (jtLEDGER_DATA, "gotFetchPack",
|
||||
BIND_TYPE (&InboundLedgers::gotFetchPack, &theApp->getInboundLedgers (), P_1));
|
||||
boost::bind (&InboundLedgers::gotFetchPack, &theApp->getInboundLedgers (), _1));
|
||||
}
|
||||
|
||||
void NetworkOPs::missingNodeInLedger (uint32 seq)
|
||||
|
||||
@@ -112,7 +112,7 @@ void RPCSub::send (const Json::Value& jvObj, bool broadcast)
|
||||
mSending = true;
|
||||
|
||||
WriteLog (lsINFO, RPCSub) << boost::str (boost::format ("callRPC start"));
|
||||
boost::thread (BIND_TYPE (&RPCSub::sendThread, this)).detach ();
|
||||
boost::thread (boost::bind (&RPCSub::sendThread, this)).detach ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ WSDoor* WSDoor::createWSDoor (const std::string& strIp, const int iPort, bool bP
|
||||
% strIp
|
||||
% iPort);
|
||||
|
||||
wdpResult->mThread = new boost::thread (BIND_TYPE (&WSDoor::startListening, wdpResult));
|
||||
wdpResult->mThread = new boost::thread (boost::bind (&WSDoor::startListening, wdpResult));
|
||||
|
||||
return wdpResult;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
static void ssendb (connection_ptr cpClient, const std::string& strMessage, bool broadcast)
|
||||
static void ssend (connection_ptr cpClient, const std::string& strMessage, bool broadcast)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -93,14 +93,14 @@ public:
|
||||
|
||||
void send (connection_ptr cpClient, message_ptr mpMessage)
|
||||
{
|
||||
cpClient->get_strand ().post (BIND_TYPE (
|
||||
cpClient->get_strand ().post (boost::bind (
|
||||
&WSServerHandler<endpoint_type>::ssend, cpClient, mpMessage));
|
||||
}
|
||||
|
||||
void send (connection_ptr cpClient, const std::string& strMessage, bool broadcast)
|
||||
{
|
||||
cpClient->get_strand ().post (BIND_TYPE (
|
||||
&WSServerHandler<endpoint_type>::ssendb, cpClient, strMessage, broadcast));
|
||||
cpClient->get_strand ().post (boost::bind (
|
||||
&WSServerHandler<endpoint_type>::ssend, cpClient, strMessage, broadcast));
|
||||
}
|
||||
|
||||
void send (connection_ptr cpClient, const Json::Value& jvObj, bool broadcast)
|
||||
|
||||
@@ -362,7 +362,7 @@ void Application::setup ()
|
||||
mJobQueue.setThreadCount (0, theConfig.RUN_STANDALONE);
|
||||
|
||||
mSweepTimer.expires_from_now (boost::posix_time::seconds (10));
|
||||
mSweepTimer.async_wait (BIND_TYPE (&Application::sweep, this));
|
||||
mSweepTimer.async_wait (boost::bind (&Application::sweep, this));
|
||||
|
||||
m_loadManager->startThread ();
|
||||
|
||||
@@ -391,7 +391,7 @@ void Application::setup ()
|
||||
LogPartition::setSeverity (lsDEBUG);
|
||||
}
|
||||
|
||||
boost::thread (BIND_TYPE (runAux, boost::ref (mAuxService))).detach ();
|
||||
boost::thread (boost::bind (runAux, boost::ref (mAuxService))).detach ();
|
||||
|
||||
if (!theConfig.RUN_STANDALONE)
|
||||
mSNTPClient.init (theConfig.SNTP_SERVERS);
|
||||
@@ -399,16 +399,16 @@ void Application::setup ()
|
||||
//
|
||||
// Construct databases.
|
||||
//
|
||||
boost::thread t1 (BIND_TYPE (&InitDB, &mRpcDB, "rpc.db", RpcDBInit, RpcDBCount));
|
||||
boost::thread t2 (BIND_TYPE (&InitDB, &mTxnDB, "transaction.db", TxnDBInit, TxnDBCount));
|
||||
boost::thread t3 (BIND_TYPE (&InitDB, &mLedgerDB, "ledger.db", LedgerDBInit, LedgerDBCount));
|
||||
boost::thread t1 (boost::bind (&InitDB, &mRpcDB, "rpc.db", RpcDBInit, RpcDBCount));
|
||||
boost::thread t2 (boost::bind (&InitDB, &mTxnDB, "transaction.db", TxnDBInit, TxnDBCount));
|
||||
boost::thread t3 (boost::bind (&InitDB, &mLedgerDB, "ledger.db", LedgerDBInit, LedgerDBCount));
|
||||
t1.join ();
|
||||
t2.join ();
|
||||
t3.join ();
|
||||
|
||||
boost::thread t4 (BIND_TYPE (&InitDB, &mWalletDB, "wallet.db", WalletDBInit, WalletDBCount));
|
||||
boost::thread t6 (BIND_TYPE (&InitDB, &mNetNodeDB, "netnode.db", NetNodeDBInit, NetNodeDBCount));
|
||||
boost::thread t7 (BIND_TYPE (&InitDB, &mPathFindDB, "pathfind.db", PathFindDBInit, PathFindDBCount));
|
||||
boost::thread t4 (boost::bind (&InitDB, &mWalletDB, "wallet.db", WalletDBInit, WalletDBCount));
|
||||
boost::thread t6 (boost::bind (&InitDB, &mNetNodeDB, "netnode.db", NetNodeDBInit, NetNodeDBCount));
|
||||
boost::thread t7 (boost::bind (&InitDB, &mPathFindDB, "pathfind.db", PathFindDBInit, PathFindDBCount));
|
||||
t4.join ();
|
||||
t6.join ();
|
||||
t7.join ();
|
||||
@@ -440,7 +440,7 @@ void Application::setup ()
|
||||
else
|
||||
{
|
||||
WriteLog (lsINFO, Application) << "SQLite used for nodes";
|
||||
boost::thread t5 (BIND_TYPE (&InitDB, &mHashNodeDB, "hashnode.db", HashNodeDBInit, HashNodeDBCount));
|
||||
boost::thread t5 (boost::bind (&InitDB, &mHashNodeDB, "hashnode.db", HashNodeDBInit, HashNodeDBCount));
|
||||
t5.join ();
|
||||
}
|
||||
|
||||
@@ -638,7 +638,7 @@ void Application::run ()
|
||||
{
|
||||
if (theConfig.NODE_SIZE >= 2)
|
||||
{
|
||||
boost::thread (BIND_TYPE (runIO, boost::ref (mIOService))).detach ();
|
||||
boost::thread (boost::bind (runIO, boost::ref (mIOService))).detach ();
|
||||
}
|
||||
|
||||
if (!theConfig.RUN_STANDALONE)
|
||||
@@ -688,7 +688,7 @@ void Application::sweep ()
|
||||
mNetOps.sweepFetchPack ();
|
||||
// VFALCO NOTE does the call to sweep() happen on another thread?
|
||||
mSweepTimer.expires_from_now (boost::posix_time::seconds (theConfig.getSize (siSweepInterval)));
|
||||
mSweepTimer.async_wait (BIND_TYPE (&Application::sweep, this));
|
||||
mSweepTimer.async_wait (boost::bind (&Application::sweep, this));
|
||||
}
|
||||
|
||||
Application::~Application ()
|
||||
|
||||
@@ -972,7 +972,7 @@ void LedgerConsensus::beginAccept (bool synchronous)
|
||||
accept (consensusSet, LoadEvent::pointer ());
|
||||
else
|
||||
{
|
||||
theApp->getIOService ().post (BIND_TYPE (&LedgerConsensus::accept, shared_from_this (), consensusSet,
|
||||
theApp->getIOService ().post (boost::bind (&LedgerConsensus::accept, shared_from_this (), consensusSet,
|
||||
theApp->getJobQueue ().getLoadEvent (jtACCEPTLEDGER, "LedgerConsensus::beginAccept")));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,13 +255,9 @@ void PeerImp::setIpPort (const std::string& strIP, int iPort)
|
||||
|
||||
void PeerImp::detach (const char* rsn, bool onIOStrand)
|
||||
{
|
||||
// VFALCO NOTE So essentially, detach() is really two different functions
|
||||
// depending on the value of onIOStrand.
|
||||
// TODO Clean this up.
|
||||
//
|
||||
if (!onIOStrand)
|
||||
{
|
||||
mIOStrand.post (BIND_TYPE (&Peer::detach, shared_from_this (), rsn, true));
|
||||
mIOStrand.post (boost::bind (&Peer::detach, shared_from_this (), rsn, true));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -525,7 +521,7 @@ void PeerImp::sendPacket (const PackedMessage::pointer& packet, bool onStrand)
|
||||
{
|
||||
if (!onStrand)
|
||||
{
|
||||
mIOStrand.post (BIND_TYPE (&Peer::sendPacket, shared_from_this (), packet, true));
|
||||
mIOStrand.post (boost::bind (&Peer::sendPacket, shared_from_this (), packet, true));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1289,10 +1285,6 @@ void PeerImp::recvHaveTxSet (protocol::TMHaveTransactionSet& packet)
|
||||
}
|
||||
|
||||
uint256 hash;
|
||||
|
||||
// VFALCO TODO There should be no use of memcpy() throughout the program.
|
||||
// TODO Clean up this magic number
|
||||
//
|
||||
memcpy (hash.begin (), packet.hash ().data (), 32);
|
||||
|
||||
if (packet.status () == protocol::tsHAVE)
|
||||
|
||||
@@ -329,7 +329,7 @@ void Peers::policyEnforce ()
|
||||
|
||||
// Schedule next enforcement.
|
||||
mPolicyTimer.expires_at (boost::posix_time::second_clock::universal_time () + boost::posix_time::seconds (POLICY_INTERVAL_SECONDS));
|
||||
mPolicyTimer.async_wait (BIND_TYPE (&Peers::policyHandler, this, P_1));
|
||||
mPolicyTimer.async_wait (boost::bind (&Peers::policyHandler, this, _1));
|
||||
}
|
||||
|
||||
void Peers::policyHandler (const boost::system::error_code& ecResult)
|
||||
@@ -856,7 +856,7 @@ void Peers::scanRefresh ()
|
||||
// % strIpPort % tpNext % (tpNext-tpNow).total_seconds());
|
||||
|
||||
mScanTimer.expires_at (tpNext);
|
||||
mScanTimer.async_wait (BIND_TYPE (&Peers::scanHandler, this, P_1));
|
||||
mScanTimer.async_wait (boost::bind (&Peers::scanHandler, this, _1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,9 +290,9 @@ void SqliteDatabase::doHook (const char* db, int pages)
|
||||
}
|
||||
|
||||
if (mWalQ)
|
||||
mWalQ->addJob (jtWAL, std::string ("WAL:") + mHost, BIND_TYPE (&SqliteDatabase::runWal, this));
|
||||
mWalQ->addJob (jtWAL, std::string ("WAL:") + mHost, boost::bind (&SqliteDatabase::runWal, this));
|
||||
else
|
||||
boost::thread (BIND_TYPE (&SqliteDatabase::runWal, this)).detach ();
|
||||
boost::thread (boost::bind (&SqliteDatabase::runWal, this)).detach ();
|
||||
}
|
||||
|
||||
void SqliteDatabase::runWal ()
|
||||
|
||||
@@ -39,7 +39,7 @@ void TransactionAcquire::done ()
|
||||
map = mMap;
|
||||
}
|
||||
|
||||
theApp->getIOService ().post (BIND_TYPE (&TACompletionHandler, mHash, map));
|
||||
theApp->getIOService ().post (boost::bind (&TACompletionHandler, mHash, map));
|
||||
}
|
||||
|
||||
void TransactionAcquire::onTimer (bool progress)
|
||||
|
||||
@@ -725,7 +725,7 @@ void UniqueNodeList::scoreNext (bool bNow)
|
||||
|
||||
// WriteLog (lsTRACE, UniqueNodeList) << str(boost::format("scoreNext: @%s") % mtpScoreNext);
|
||||
mdtScoreTimer.expires_at (mtpScoreNext);
|
||||
mdtScoreTimer.async_wait (BIND_TYPE (&UniqueNodeList::scoreTimerHandler, this, P_1));
|
||||
mdtScoreTimer.async_wait (boost::bind (&UniqueNodeList::scoreTimerHandler, this, _1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -971,7 +971,7 @@ void UniqueNodeList::getIpsUrl (const RippleAddress& naNodePublic, Section secSi
|
||||
strPath,
|
||||
NODE_FILE_BYTES_MAX,
|
||||
boost::posix_time::seconds (NODE_FETCH_SECONDS),
|
||||
BIND_TYPE (&UniqueNodeList::responseIps, this, strDomain, naNodePublic, P_1, P_2, P_3));
|
||||
boost::bind (&UniqueNodeList::responseIps, this, strDomain, naNodePublic, _1, _2, _3));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1273,7 +1273,7 @@ void UniqueNodeList::fetchNext ()
|
||||
mtpFetchNext = tpNext;
|
||||
|
||||
mdtFetchTimer.expires_at (mtpFetchNext);
|
||||
mdtFetchTimer.async_wait (BIND_TYPE (&UniqueNodeList::fetchTimerHandler, this, P_1));
|
||||
mdtFetchTimer.async_wait (boost::bind (&UniqueNodeList::fetchTimerHandler, this, _1));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user