mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
disabled more debug output.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4825 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
6ac2cad4aa
commit
6b2a6e771b
@ -143,8 +143,10 @@ int bdFilter::addrOkay(struct sockaddr_in *addr)
|
||||
{
|
||||
return 1; // Address is Okay!
|
||||
}
|
||||
#ifdef DEBUG_FILTER
|
||||
std::cerr << "Detected Packet From Banned Ip Address: " << inet_ntoa(addr->sin_addr);
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -181,6 +183,7 @@ bool bdFilter::isOwnIdWithoutBitDhtFlags(const bdId *id, uint32_t peerFlags)
|
||||
|
||||
bool bdFilter::cleanupFilter()
|
||||
{
|
||||
#ifdef DEBUG_FILTER
|
||||
std::cerr << "bdFilter::cleanupFilter() Current BanList" << std::endl;
|
||||
struct in_addr inaddr;
|
||||
|
||||
@ -190,10 +193,13 @@ bool bdFilter::cleanupFilter()
|
||||
inaddr.s_addr = *sit;
|
||||
std::cerr << "\tBanned: " << inet_ntoa(inaddr) << std::endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
mIpsBanned.clear();
|
||||
|
||||
#ifdef DEBUG_FILTER
|
||||
std::cerr << "Filter List:" << std::endl;
|
||||
#endif
|
||||
|
||||
time_t now = time(NULL);
|
||||
time_t dropTime = now - BDFILTER_ENTRY_DROP_PERIOD;
|
||||
@ -201,20 +207,26 @@ bool bdFilter::cleanupFilter()
|
||||
std::list<bdFilteredPeer>::iterator it;
|
||||
for(it = mFiltered.begin(); it != mFiltered.end();)
|
||||
{
|
||||
#ifdef DEBUG_FILTER
|
||||
std::cerr << "\t" << inet_ntoa(it->mAddr.sin_addr);
|
||||
std::cerr << " Flags: " << it->mFilterFlags;
|
||||
std::cerr << " FilterTS: " << now - it->mFilterTS;
|
||||
std::cerr << " LastSeen: " << now - it->mLastSeen;
|
||||
#endif
|
||||
|
||||
if (it->mLastSeen < dropTime)
|
||||
{
|
||||
/* remove from filter */
|
||||
#ifdef DEBUG_FILTER
|
||||
std::cerr << " OLD DROPPING" << std::endl;
|
||||
#endif
|
||||
it = mFiltered.erase(it);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef DEBUG_FILTER
|
||||
std::cerr << " OK" << std::endl;
|
||||
#endif
|
||||
uint32_t saddr = it->mAddr.sin_addr.s_addr;
|
||||
mIpsBanned.insert(saddr);
|
||||
|
||||
|
@ -85,10 +85,12 @@ bdFriendList::bdFriendList(const bdNodeId *ownId)
|
||||
/* catch-all interface function */
|
||||
bool bdFriendList::updatePeer(const bdId *id, uint32_t flags)
|
||||
{
|
||||
#ifdef DEBUG_FRIENDLIST
|
||||
std::cerr << "bdFriendList::updatePeer() Peer(";
|
||||
bdStdPrintId(std::cerr, id);
|
||||
std::cerr << ") Flags: " << flags;
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
std::map<bdNodeId, bdFriendEntry>::iterator it;
|
||||
it = mPeers.find(id->id);
|
||||
@ -122,10 +124,12 @@ bool bdFriendList::removePeer(const bdNodeId *id)
|
||||
it = mPeers.find(*id);
|
||||
if (it == mPeers.end())
|
||||
{
|
||||
#ifdef DEBUG_FRIENDLIST
|
||||
std::cerr << "bdFriendList::removeFriend() Peer(";
|
||||
bdStdPrintNodeId(std::cerr, id);
|
||||
std::cerr << ") is unknown!";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user