mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-25 23:00:56 -04:00
bitdht improvements
* Added bdHistory, to monitoring all the p2p dht messages (disabled normally) * cleaned up all compile warnings on OSX. * added Found timestamp to peer info. * disable save, until store is close to full. * ...?other stuff? git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3559 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
327af4ca61
commit
c9229fb6e8
11 changed files with 447 additions and 38 deletions
|
@ -94,7 +94,7 @@ int bdStore::getPeer(bdPeer *peer)
|
|||
|
||||
std::list<bdPeer>::iterator it;
|
||||
int i = 0;
|
||||
for(it = store.begin(); (it != store.end()) && (i < mIndex); it++, i++);
|
||||
for(it = store.begin(); (it != store.end()) && (i < mIndex); it++, i++) ; /* empty loop */
|
||||
if (it != store.end())
|
||||
{
|
||||
*peer = *it;
|
||||
|
@ -161,6 +161,16 @@ void bdStore::writeStore(std::string file)
|
|||
fprintf(stderr, "bdStore::writeStore(%s) = %d entries\n", file.c_str(), store.size());
|
||||
#endif
|
||||
|
||||
if (store.size() < 0.9 * MAX_ENTRIES)
|
||||
{
|
||||
/* don't save yet! */
|
||||
#ifdef DEBUG_STORE
|
||||
fprintf(stderr, "bdStore::writeStore() Delaying until more entries\n");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
FILE *fd = fopen(file.c_str(), "w");
|
||||
|
||||
if (!fd)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue