Roll back 7 commits

This commit is contained in:
Vinnie Falco
2013-06-28 11:48:02 -07:00
parent d80547e980
commit 832f67b35c
31 changed files with 75 additions and 186 deletions

View File

@@ -22,13 +22,8 @@
// beast_basics flags // beast_basics flags
#define BEAST_USE_BOOST 1 #ifndef BEAST_USE_BOOST
#define BEAST_USE_BOOST 0
// 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
#endif #endif
#ifndef BEAST_USE_LEAKCHECKED #ifndef BEAST_USE_LEAKCHECKED

View File

@@ -12,7 +12,7 @@
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup> <ItemDefinitionGroup>
<ClCompile> <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> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<WarningLevel>Level3</WarningLevel> <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> <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>

View File

@@ -222,12 +222,12 @@
@todo Discuss the treatment of exceptions versus Error objects in the library. @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 @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. This file must always be included before any Juce headers.
@@ -238,7 +238,7 @@
/* BeastConfig.h must be included before this file */ /* BeastConfig.h must be included before this file */
/* Use sensible default configurations if they forgot /* 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 #ifndef BEAST_USE_BOOST
#define BEAST_USE_BOOST 0 #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 // Choose a source of bind, placeholders, and function
#if !BEAST_BIND_USES_STD && !BEAST_BIND_USES_TR1 && !BEAST_BIND_USES_BOOST #if !BEAST_BIND_USES_STD && !BEAST_BIND_USES_TR1 && !BEAST_BIND_USES_BOOST

View File

@@ -20,17 +20,7 @@
#ifndef BEAST_BIND_BEASTHEADER #ifndef BEAST_BIND_BEASTHEADER
#define 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. /* 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 #ifndef BEAST_BIND_PLACEHOLDERS_N
@@ -58,7 +48,6 @@
#if BEAST_BIND_USES_STD #if BEAST_BIND_USES_STD
using std::ref; using std::ref;
using std::cref;
using std::bind; using std::bind;
using std::function; using std::function;
@@ -147,7 +136,6 @@ using std::placeholders::_20;
#elif BEAST_BIND_USES_TR1 #elif BEAST_BIND_USES_TR1
using std::tr1::ref; using std::tr1::ref;
using std::tr1::cref;
using std::tr1::bind; using std::tr1::bind;
using std::tr1::function; using std::tr1::function;
@@ -236,7 +224,6 @@ using std::tr1::placeholders::_20;
#elif BEAST_BIND_USES_BOOST #elif BEAST_BIND_USES_BOOST
using boost::ref; using boost::ref;
using boost::cref;
using boost::bind; using boost::bind;
using boost::function; using boost::function;

View File

@@ -551,13 +551,10 @@ void server<endpoint>::connection<connection_type>::async_init() {
m_connection.register_timeout(5000,fail::status::TIMEOUT_WS, m_connection.register_timeout(5000,fail::status::TIMEOUT_WS,
"Timeout on WebSocket handshake"); "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>(); boost::shared_ptr<std::string> stringPtr = boost::make_shared<std::string>();
m_connection.get_socket().async_read_until( m_connection.get_socket().async_read_until(
m_connection.buffer(), m_connection.buffer(),
boost::bind(&match_header, stringPtr, pl1, pl2), boost::bind(&match_header, stringPtr, _1, _2),
m_connection.get_strand().wrap(boost::bind( m_connection.get_strand().wrap(boost::bind(
&type::handle_read_request, &type::handle_read_request,
m_connection.shared_from_this(), m_connection.shared_from_this(),

View File

@@ -2,13 +2,6 @@
TODO 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 (!) - Fix all leaks on exit (!)
Say there's a leak, a ledger that can never be accessed is locked in some 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. - 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 - 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 - Make LevelDB and Ripple code work with both Unicode and non-Unicode Windows APIs

View File

@@ -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!!! // VFALCO NOTE Holy smokes...that's a lot of boost!!!
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/predicate.hpp> #include <boost/algorithm/string/predicate.hpp>
@@ -29,6 +24,7 @@
#include <boost/bimap/list_of.hpp> #include <boost/bimap/list_of.hpp>
#include <boost/bimap/multiset_of.hpp> #include <boost/bimap/multiset_of.hpp>
#include <boost/bimap/unordered_set_of.hpp> #include <boost/bimap/unordered_set_of.hpp>
#include <boost/bind.hpp>
#include <boost/cstdint.hpp> #include <boost/cstdint.hpp>
#include <boost/date_time/posix_time/posix_time_types.hpp> #include <boost/date_time/posix_time/posix_time_types.hpp>
#include <boost/enable_shared_from_this.hpp> #include <boost/enable_shared_from_this.hpp>
@@ -75,6 +71,8 @@
#include "../ripple_data/ripple_data.h" #include "../ripple_data/ripple_data.h"
#include "../modules/ripple_websocket/ripple_websocket.h" #include "../modules/ripple_websocket/ripple_websocket.h"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------

View File

@@ -10,8 +10,6 @@
@ingroup ripple_basics @ingroup ripple_basics
*/ */
#include "BeastConfig.h"
#include "ripple_basics.h" #include "ripple_basics.h"
// VFALCO TODO Rewrite Sustain to use beast::Process // VFALCO TODO Rewrite Sustain to use beast::Process

View File

@@ -22,35 +22,10 @@
#include "system/ripple_StandardIncludes.h" #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_BoostIncludes.h"
#include "system/ripple_OpenSSLIncludes.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 // ByteOrder
#ifdef WIN32 #ifdef WIN32
// (nothing) // (nothing)
@@ -62,8 +37,10 @@ namespace boost
# include <sys/types.h> # include <sys/types.h>
#endif #endif
#include "BeastConfig.h" // Must come before any Beast includes
#include "modules/beast_core/beast_core.h" #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 // VFALCO TODO Fix this for FreeBSD
//#include "modules/beast_basics/beast_basics.h" //#include "modules/beast_basics/beast_basics.h"
@@ -73,7 +50,17 @@ namespace boost
namespace ripple 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 #include "utility/ripple_Log.h" // Needed by others

View File

@@ -7,30 +7,36 @@
#ifndef RIPPLE_PLATFORMMACROS_H #ifndef RIPPLE_PLATFORMMACROS_H
#define 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 // VFALCO TODO Clean this up
#if (!defined(FORCE_NO_C11X) && (__cplusplus > 201100L)) || defined(FORCE_C11X) #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 C11X
#define UPTR_T std::unique_ptr #define UPTR_T std::unique_ptr
#define MOVE_P(p) std::move(p) #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 #else
#define UPTR_T std::auto_ptr #define UPTR_T std::auto_ptr
#define MOVE_P(p) (p) #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 #endif
// VFALCO TODO Clean this stuff up. Remove as much as possible // VFALCO TODO Clean this junk up
#define nothing() do {} while (0) #define nothing() do {} while (0)
#define fallthru() do {} while (0) #define fallthru() do {} while (0)
#define NUMBER(x) (sizeof(x)/sizeof((x)[0])) #define NUMBER(x) (sizeof(x)/sizeof((x)[0]))

View File

@@ -12,9 +12,6 @@ class JobQueue
public: public:
explicit JobQueue (boost::asio::io_service&); 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); void addJob (JobType type, const std::string& name, const FUNCTION_TYPE<void (Job&)>& job);
int getJobCount (JobType t); // Jobs waiting at this priority int getJobCount (JobType t); // Jobs waiting at this priority

View File

@@ -10,8 +10,6 @@
@ingroup ripple_core @ingroup ripple_core
*/ */
#include "BeastConfig.h"
#include "ripple_core.h" #include "ripple_core.h"
#include <fstream> #include <fstream>

View File

@@ -10,8 +10,6 @@
@ingroup ripple_data @ingroup ripple_data
*/ */
#include "BeastConfig.h"
#include "ripple_data.h" #include "ripple_data.h"
#include <algorithm> #include <algorithm>

View File

@@ -10,8 +10,6 @@
@ingroup ripple_json @ingroup ripple_json
*/ */
#include "BeastConfig.h"
#include "ripple_json.h" #include "ripple_json.h"
#include <stdexcept> #include <stdexcept>

View File

@@ -6,8 +6,6 @@
// Unity build file for LevelDB // Unity build file for LevelDB
#include "BeastConfig.h"
#include "ripple_leveldb.h" #include "ripple_leveldb.h"
#include "beast/modules/beast_core/system/beast_TargetPlatform.h" #include "beast/modules/beast_core/system/beast_TargetPlatform.h"

View File

@@ -10,8 +10,6 @@
@ingroup ripple_sqlite @ingroup ripple_sqlite
*/ */
#include "BeastConfig.h"
// This prevents sqlite.h from being included // This prevents sqlite.h from being included
// //
#define RIPPLE_SQLITE_MODULE_INCLUDED 1 #define RIPPLE_SQLITE_MODULE_INCLUDED 1

View File

@@ -90,7 +90,7 @@ public:
mSocket->set_verify_mode (boost::asio::ssl::verify_peer); mSocket->set_verify_mode (boost::asio::ssl::verify_peer);
// XXX Verify semantics of RFC 2818 are what we want. // 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; return ec;
} }

View File

@@ -4,8 +4,6 @@
*/ */
//============================================================================== //==============================================================================
#include "BeastConfig.h"
#ifndef __STDC_LIMIT_MACROS #ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1 #define __STDC_LIMIT_MACROS 1
#endif #endif

View File

@@ -66,7 +66,7 @@ extern void callRPC (
const std::string& strUsername, const std::string& strPassword, const std::string& strUsername, const std::string& strPassword,
const std::string& strPath, const std::string& strMethod, const std::string& strPath, const std::string& strMethod,
const Json::Value& jvParams, const bool bSSL, 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 #endif
// vim:ts=4 // vim:ts=4

View File

@@ -306,7 +306,7 @@ bool LedgerMaster::acquireMissingLedger (Ledger::ref origLedger, uint256 const&
if (mMissingLedger->setAccept ()) if (mMissingLedger->setAccept ())
{ {
if (!mMissingLedger->addOnComplete (BIND_TYPE (&LedgerMaster::missingAcquireComplete, this, P_1))) 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); int fetchMax = theConfig.getSize (siLedgerFetch);

View File

@@ -312,7 +312,7 @@ void NetworkOPs::runTransactionQueue ()
} }
if (theApp->getTxnQueue ().stopProcessing (txn)) 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) 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; mLastFetchPack = 0;
mFetchSeq = seq; // earliest pack we have data on mFetchSeq = seq; // earliest pack we have data on
theApp->getJobQueue ().addJob (jtLEDGER_DATA, "gotFetchPack", 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) void NetworkOPs::missingNodeInLedger (uint32 seq)

View File

@@ -112,7 +112,7 @@ void RPCSub::send (const Json::Value& jvObj, bool broadcast)
mSending = true; mSending = true;
WriteLog (lsINFO, RPCSub) << boost::str (boost::format ("callRPC start")); 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 ();
} }
} }

View File

@@ -82,7 +82,7 @@ WSDoor* WSDoor::createWSDoor (const std::string& strIp, const int iPort, bool bP
% strIp % strIp
% iPort); % iPort);
wdpResult->mThread = new boost::thread (BIND_TYPE (&WSDoor::startListening, wdpResult)); wdpResult->mThread = new boost::thread (boost::bind (&WSDoor::startListening, wdpResult));
return wdpResult; return wdpResult;
} }

View File

@@ -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 try
{ {
@@ -93,14 +93,14 @@ public:
void send (connection_ptr cpClient, message_ptr mpMessage) 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)); &WSServerHandler<endpoint_type>::ssend, cpClient, mpMessage));
} }
void send (connection_ptr cpClient, const std::string& strMessage, bool broadcast) void send (connection_ptr cpClient, const std::string& strMessage, bool broadcast)
{ {
cpClient->get_strand ().post (BIND_TYPE ( cpClient->get_strand ().post (boost::bind (
&WSServerHandler<endpoint_type>::ssendb, cpClient, strMessage, broadcast)); &WSServerHandler<endpoint_type>::ssend, cpClient, strMessage, broadcast));
} }
void send (connection_ptr cpClient, const Json::Value& jvObj, bool broadcast) void send (connection_ptr cpClient, const Json::Value& jvObj, bool broadcast)

View File

@@ -362,7 +362,7 @@ void Application::setup ()
mJobQueue.setThreadCount (0, theConfig.RUN_STANDALONE); mJobQueue.setThreadCount (0, theConfig.RUN_STANDALONE);
mSweepTimer.expires_from_now (boost::posix_time::seconds (10)); 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 (); m_loadManager->startThread ();
@@ -391,7 +391,7 @@ void Application::setup ()
LogPartition::setSeverity (lsDEBUG); 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) if (!theConfig.RUN_STANDALONE)
mSNTPClient.init (theConfig.SNTP_SERVERS); mSNTPClient.init (theConfig.SNTP_SERVERS);
@@ -399,16 +399,16 @@ void Application::setup ()
// //
// Construct databases. // Construct databases.
// //
boost::thread t1 (BIND_TYPE (&InitDB, &mRpcDB, "rpc.db", RpcDBInit, RpcDBCount)); boost::thread t1 (boost::bind (&InitDB, &mRpcDB, "rpc.db", RpcDBInit, RpcDBCount));
boost::thread t2 (BIND_TYPE (&InitDB, &mTxnDB, "transaction.db", TxnDBInit, TxnDBCount)); boost::thread t2 (boost::bind (&InitDB, &mTxnDB, "transaction.db", TxnDBInit, TxnDBCount));
boost::thread t3 (BIND_TYPE (&InitDB, &mLedgerDB, "ledger.db", LedgerDBInit, LedgerDBCount)); boost::thread t3 (boost::bind (&InitDB, &mLedgerDB, "ledger.db", LedgerDBInit, LedgerDBCount));
t1.join (); t1.join ();
t2.join (); t2.join ();
t3.join (); t3.join ();
boost::thread t4 (BIND_TYPE (&InitDB, &mWalletDB, "wallet.db", WalletDBInit, WalletDBCount)); boost::thread t4 (boost::bind (&InitDB, &mWalletDB, "wallet.db", WalletDBInit, WalletDBCount));
boost::thread t6 (BIND_TYPE (&InitDB, &mNetNodeDB, "netnode.db", NetNodeDBInit, NetNodeDBCount)); boost::thread t6 (boost::bind (&InitDB, &mNetNodeDB, "netnode.db", NetNodeDBInit, NetNodeDBCount));
boost::thread t7 (BIND_TYPE (&InitDB, &mPathFindDB, "pathfind.db", PathFindDBInit, PathFindDBCount)); boost::thread t7 (boost::bind (&InitDB, &mPathFindDB, "pathfind.db", PathFindDBInit, PathFindDBCount));
t4.join (); t4.join ();
t6.join (); t6.join ();
t7.join (); t7.join ();
@@ -440,7 +440,7 @@ void Application::setup ()
else else
{ {
WriteLog (lsINFO, Application) << "SQLite used for nodes"; 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 (); t5.join ();
} }
@@ -638,7 +638,7 @@ void Application::run ()
{ {
if (theConfig.NODE_SIZE >= 2) 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) if (!theConfig.RUN_STANDALONE)
@@ -688,7 +688,7 @@ void Application::sweep ()
mNetOps.sweepFetchPack (); mNetOps.sweepFetchPack ();
// VFALCO NOTE does the call to sweep() happen on another thread? // VFALCO NOTE does the call to sweep() happen on another thread?
mSweepTimer.expires_from_now (boost::posix_time::seconds (theConfig.getSize (siSweepInterval))); 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 () Application::~Application ()

View File

@@ -972,7 +972,7 @@ void LedgerConsensus::beginAccept (bool synchronous)
accept (consensusSet, LoadEvent::pointer ()); accept (consensusSet, LoadEvent::pointer ());
else 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"))); theApp->getJobQueue ().getLoadEvent (jtACCEPTLEDGER, "LedgerConsensus::beginAccept")));
} }
} }

View File

@@ -255,13 +255,9 @@ void PeerImp::setIpPort (const std::string& strIP, int iPort)
void PeerImp::detach (const char* rsn, bool onIOStrand) 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) 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; return;
} }
@@ -525,7 +521,7 @@ void PeerImp::sendPacket (const PackedMessage::pointer& packet, bool onStrand)
{ {
if (!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; return;
} }
@@ -1289,10 +1285,6 @@ void PeerImp::recvHaveTxSet (protocol::TMHaveTransactionSet& packet)
} }
uint256 hash; 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); memcpy (hash.begin (), packet.hash ().data (), 32);
if (packet.status () == protocol::tsHAVE) if (packet.status () == protocol::tsHAVE)

View File

@@ -329,7 +329,7 @@ void Peers::policyEnforce ()
// Schedule next enforcement. // Schedule next enforcement.
mPolicyTimer.expires_at (boost::posix_time::second_clock::universal_time () + boost::posix_time::seconds (POLICY_INTERVAL_SECONDS)); 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) void Peers::policyHandler (const boost::system::error_code& ecResult)
@@ -856,7 +856,7 @@ void Peers::scanRefresh ()
// % strIpPort % tpNext % (tpNext-tpNow).total_seconds()); // % strIpPort % tpNext % (tpNext-tpNow).total_seconds());
mScanTimer.expires_at (tpNext); mScanTimer.expires_at (tpNext);
mScanTimer.async_wait (BIND_TYPE (&Peers::scanHandler, this, P_1)); mScanTimer.async_wait (boost::bind (&Peers::scanHandler, this, _1));
} }
} }
} }

View File

@@ -290,9 +290,9 @@ void SqliteDatabase::doHook (const char* db, int pages)
} }
if (mWalQ) 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 else
boost::thread (BIND_TYPE (&SqliteDatabase::runWal, this)).detach (); boost::thread (boost::bind (&SqliteDatabase::runWal, this)).detach ();
} }
void SqliteDatabase::runWal () void SqliteDatabase::runWal ()

View File

@@ -39,7 +39,7 @@ void TransactionAcquire::done ()
map = mMap; map = mMap;
} }
theApp->getIOService ().post (BIND_TYPE (&TACompletionHandler, mHash, map)); theApp->getIOService ().post (boost::bind (&TACompletionHandler, mHash, map));
} }
void TransactionAcquire::onTimer (bool progress) void TransactionAcquire::onTimer (bool progress)

View File

@@ -725,7 +725,7 @@ void UniqueNodeList::scoreNext (bool bNow)
// WriteLog (lsTRACE, UniqueNodeList) << str(boost::format("scoreNext: @%s") % mtpScoreNext); // WriteLog (lsTRACE, UniqueNodeList) << str(boost::format("scoreNext: @%s") % mtpScoreNext);
mdtScoreTimer.expires_at (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, strPath,
NODE_FILE_BYTES_MAX, NODE_FILE_BYTES_MAX,
boost::posix_time::seconds (NODE_FETCH_SECONDS), 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 else
{ {
@@ -1273,7 +1273,7 @@ void UniqueNodeList::fetchNext ()
mtpFetchNext = tpNext; mtpFetchNext = tpNext;
mdtFetchTimer.expires_at (mtpFetchNext); mdtFetchTimer.expires_at (mtpFetchNext);
mdtFetchTimer.async_wait (BIND_TYPE (&UniqueNodeList::fetchTimerHandler, this, P_1)); mdtFetchTimer.async_wait (boost::bind (&UniqueNodeList::fetchTimerHandler, this, _1));
} }
else else
{ {