fix save prevention when coring in malloc/free.

This commit is contained in:
Matt Wells
2015-08-23 11:51:46 -07:00
parent a5a9820441
commit a4bfbb31f8
3 changed files with 7 additions and 2 deletions

@ -302,8 +302,8 @@ bool Rebalance::saveRebalanceFile ( ) {
binToHex ( (unsigned char *)&m_nextKey , MAX_KEY_BYTES , keyStr );
//log("db: saving rebalance.txt");
SafeBuf sb;
char tmp[30000];
SafeBuf sb(tmp,30000);
sb.safePrintf (
"myshard: %"INT32"\n"
"numshards: %"INT32"\n"

@ -249,6 +249,10 @@ bool resetProxyStats ( ) {
// save the stats
bool saveSpiderProxyStats ( ) {
// do not save if coring in a malloc/free because we call malloc/free
// below to save stuff possibly
if ( g_inMemFunction ) return true;
// save hashtable
s_proxyBannedTable.save(g_hostdb.m_dir,"proxybantable.dat");

@ -114,6 +114,7 @@ Users::~Users(){
}
bool Users::save(){
return true;
if ( ! m_needsSave ) return true;
if ( ! m_loginTable.save(g_hostdb.m_dir,"userlogin.dat",NULL,0) )
return log("users: userlogin.dat save failed");