diff --git a/SConstruct b/SConstruct index 53745565f8..bc057ada7e 100644 --- a/SConstruct +++ b/SConstruct @@ -7,9 +7,10 @@ import platform OSX = bool(platform.mac_ver()[0]) FreeBSD = bool('FreeBSD' == platform.system()) -Ubuntu = bool('Ubuntu' == platform.dist()) +Linux = bool('Linux' == platform.system()) +Ubuntu = bool(Linux and 'Ubuntu' == platform.linux_distribution()[0]) -if OSX: +if OSX or Ubuntu: CTAGS = '/usr/bin/ctags' else: CTAGS = '/usr/bin/exuberant-ctags' diff --git a/src/cpp/database/SqliteDatabase.cpp b/src/cpp/database/SqliteDatabase.cpp index 4575a9e8b4..5de22db964 100644 --- a/src/cpp/database/SqliteDatabase.cpp +++ b/src/cpp/database/SqliteDatabase.cpp @@ -27,7 +27,7 @@ void SqliteDatabase::connect() int rc = sqlite3_open(mHost.c_str(), &mConnection); if (rc) { - cLog(lsFATAL) << "Can't open database: " << mHost << " " << rc; + cLog(lsFATAL) << "Can't open " << mHost << " " << rc; sqlite3_close(mConnection); assert((rc != SQLITE_BUSY) && (rc != SQLITE_LOCKED)); } @@ -51,7 +51,7 @@ bool SqliteDatabase::executeSQL(const char* sql, bool fail_ok) if (!fail_ok) { #ifdef DEBUG - cLog(lsWARNING) << "SQL Perror:" << rc; + cLog(lsWARNING) << "Perror:" << mHost << ": " << rc; cLog(lsWARNING) << "Statement: " << sql; cLog(lsWARNING) << "Error: " << sqlite3_errmsg(mConnection); #endif @@ -69,13 +69,17 @@ bool SqliteDatabase::executeSQL(const char* sql, bool fail_ok) } else { - assert((rc != SQLITE_BUSY) && (rc != SQLITE_LOCKED)); + if ((rc != SQLITE_BUSY) && (rc != SQLITE_LOCKED)) + { + cLog(lsFATAL) << mHost << " returns error " << rc << ": " << sqlite3_errmsg(mConnection); + assert(false); + } mMoreRows = false; if (!fail_ok) { #ifdef DEBUG - cLog(lsWARNING) << "SQL Serror:" << rc; + cLog(lsWARNING) << "SQL Serror:" << mHost << ": " << rc; cLog(lsWARNING) << "Statement: " << sql; cLog(lsWARNING) << "Error: " << sqlite3_errmsg(mConnection); #endif @@ -135,7 +139,7 @@ bool SqliteDatabase::getNextRow() else { assert((rc != SQLITE_BUSY) && (rc != SQLITE_LOCKED)); - cLog(lsWARNING) << "SQL Rerror:" << rc; + cLog(lsWARNING) << "Rerror: " << mHost << ": " << rc; return(false); } } @@ -244,8 +248,8 @@ void SqliteDatabase::runWal() int ret = sqlite3_wal_checkpoint_v2(mConnection, db.c_str(), SQLITE_CHECKPOINT_PASSIVE, &log, &ckpt); if (ret != SQLITE_OK) { - cLog((ret == SQLITE_LOCKED) ? lsDEBUG : lsWARNING) << "WAL " - << sqlite3_db_filename(mConnection, "main") << " / " << db << " errror " << ret; + cLog((ret == SQLITE_LOCKED) ? lsDEBUG : lsWARNING) << "WAL " << mHost << ":" + << db << " errror " << ret; } } walSet.clear(); diff --git a/src/cpp/ripple/Application.cpp b/src/cpp/ripple/Application.cpp index bb615cec3f..2f5d9f68a1 100644 --- a/src/cpp/ripple/Application.cpp +++ b/src/cpp/ripple/Application.cpp @@ -166,7 +166,7 @@ void Application::setup() // // Allow peer connections. // - if (!theConfig.RUN_STANDALONE && !theConfig.PEER_IP.empty() && theConfig.PEER_PORT) + if (!theConfig.RUN_STANDALONE) { try { diff --git a/src/cpp/ripple/CallRPC.cpp b/src/cpp/ripple/CallRPC.cpp index 7d8ad67e30..d8b3296e68 100644 --- a/src/cpp/ripple/CallRPC.cpp +++ b/src/cpp/ripple/CallRPC.cpp @@ -694,7 +694,7 @@ int commandLineRPC(const std::vector& vCmd) return nRet; } -#define RPC_NOTIFY_MAX_BYTES 8192 +#define RPC_REPLY_MAX_BYTES (128*1024*1024) #define RPC_NOTIFY_SECONDS 10 bool responseRPC( @@ -787,7 +787,7 @@ void callRPC( jvParams, mapRequestHeaders, "/", _1, _2), - RPC_NOTIFY_MAX_BYTES, + RPC_REPLY_MAX_BYTES, boost::posix_time::seconds(RPC_NOTIFY_SECONDS), boost::bind(&responseRPC, callbackFuncP, _1, _2, _3)); } diff --git a/src/cpp/ripple/PeerDoor.cpp b/src/cpp/ripple/PeerDoor.cpp index 9ce77f45e1..8d0c1c0aed 100644 --- a/src/cpp/ripple/PeerDoor.cpp +++ b/src/cpp/ripple/PeerDoor.cpp @@ -35,9 +35,12 @@ PeerDoor::PeerDoor(boost::asio::io_service& io_service) : if (1 != SSL_CTX_set_cipher_list(mCtx.native_handle(), theConfig.PEER_SSL_CIPHER_LIST.c_str())) std::runtime_error("Error setting cipher list (no valid ciphers)."); - Log(lsINFO) << "Peer port: " << theConfig.PEER_IP << " " << theConfig.PEER_PORT; - startListening(); + if (!theConfig.PEER_IP.empty() && theConfig.PEER_PORT) + { + Log(lsINFO) << "Peer port: " << theConfig.PEER_IP << " " << theConfig.PEER_PORT; + startListening(); + } } void PeerDoor::startListening()