|
From: Max Z. <ma...@us...> - 2007-01-05 10:49:22
|
Update of /cvsroot/mutella/mutella/mutella In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23949 Modified Files: gnucache.cpp gnucache.h gnunode.cpp Log Message: some works on blacklisting Index: gnucache.cpp =================================================================== RCS file: /cvsroot/mutella/mutella/mutella/gnucache.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** gnucache.cpp 17 Nov 2002 14:22:24 -0000 1.20 --- gnucache.cpp 5 Jan 2007 10:49:17 -0000 1.21 *************** *** 36,39 **** --- 36,41 ---- #include "common.h" #include "conversions.h" + #include "property.h" + #include "preferences.h" ////////////////////////////////////////////////////////////////////// *************** *** 44,47 **** --- 46,50 ---- { m_pDirector = pCntr; + m_pPrefs = m_pDirector->GetPrefs(); } *************** *** 54,57 **** --- 57,64 ---- if( node.Port > 0 ) { + // blacklist support + if (m_pPrefs->m_bBlackListActive && m_pPrefs->m_ipnetsetBlackList.IsIn(node.Host)) + return; + // MLock lock(m_mutex); if (CheckIfNotRecent(node.Host) && *************** *** 177,180 **** --- 184,191 ---- void MGnuCache::Add(const Node& node) { + // blacklist support + if (m_pPrefs->m_bBlackListActive && m_pPrefs->m_ipnetsetBlackList.IsIn(node.Host)) + return; + // MLock lock(m_mutex); for(list<Node>::iterator itNode = m_listCache.begin(); itNode != m_listCache.end(); itNode++) Index: gnucache.h =================================================================== RCS file: /cvsroot/mutella/mutella/mutella/gnucache.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** gnucache.h 4 Nov 2002 10:57:49 -0000 1.9 --- gnucache.h 5 Jan 2007 10:49:17 -0000 1.10 *************** *** 25,28 **** --- 25,29 ---- class MGnuDirector; + struct MGnuPreferences; class MGnuCache *************** *** 55,58 **** --- 56,60 ---- // MGnuDirector* m_pDirector; + MGnuPreferences* m_pPrefs; private: MGnuCache(); // no implementation Index: gnunode.cpp =================================================================== RCS file: /cvsroot/mutella/mutella/mutella/gnunode.cpp,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** gnunode.cpp 13 Jun 2006 14:42:10 -0000 1.84 --- gnunode.cpp 5 Jan 2007 10:49:17 -0000 1.85 *************** *** 1111,1115 **** if (type == PACKET_PONG && ((packet_Header*)(itPacket->Packet))->TTL <= 1) { ! TRACE2("MGnuNode::SendPacket() : canceling drop for a packet with TTL %d", ((packet_Header*)(itPacket->Packet))->TTL); break; } --- 1111,1115 ---- if (type == PACKET_PONG && ((packet_Header*)(itPacket->Packet))->TTL <= 1) { ! TRACE2("MGnuNode::SendPacket() : canceling drop for a packet with TTL ", ((packet_Header*)(itPacket->Packet))->TTL); break; } |