mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-27 16:35:21 -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
50
libbitdht/src/bitdht/bdhistory.h
Normal file
50
libbitdht/src/bitdht/bdhistory.h
Normal file
|
@ -0,0 +1,50 @@
|
|||
#ifndef BITDHT_HISTORY_H
|
||||
#define BITDHT_HISTORY_H
|
||||
|
||||
#include "bitdht/bdpeer.h"
|
||||
#include "bitdht/bdobj.h"
|
||||
#include <map>
|
||||
|
||||
#define MSG_TYPE_DIRECTION_MASK 0x000f0000
|
||||
|
||||
#define MSG_DIRECTION_INCOMING 0x00010000
|
||||
#define MSG_DIRECTION_OUTGOING 0x00020000
|
||||
|
||||
/**** DEBUGGING HISTORY ****/
|
||||
|
||||
class bdMsgHistoryList
|
||||
{
|
||||
public:
|
||||
|
||||
void addMsg(time_t ts, uint32_t msgType, bool incoming);
|
||||
int msgCount(time_t start_ts, time_t end_ts);
|
||||
void msgClear();
|
||||
void printHistory(std::ostream &out, int mode, time_t start_ts, time_t end_ts);
|
||||
|
||||
bool canSend();
|
||||
bool validPeer();
|
||||
|
||||
std::multimap<time_t, uint32_t> msgHistory;
|
||||
};
|
||||
|
||||
|
||||
|
||||
class bdHistory
|
||||
{
|
||||
public:
|
||||
void addMsg(const bdId *id, bdToken *transId, uint32_t msgType, bool incoming);
|
||||
void printMsgs();
|
||||
void clearHistory();
|
||||
|
||||
bool canSend(const bdId *id);
|
||||
bool validPeer(const bdId *id);
|
||||
|
||||
/* recent history */
|
||||
//std::list<bdId> lastMsgs;
|
||||
std::map<bdId, bdMsgHistoryList> mHistory;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue