mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-06 21:58:57 -04:00
removed some dead code
This commit is contained in:
parent
a1bbcd829d
commit
509266a25b
2 changed files with 1 additions and 139 deletions
|
@ -311,7 +311,7 @@ bool addAddressIfUnique(std::list<peerConnectAddress> &addrList, peerConnectAdd
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// These should have there own Mutex Protection,
|
// These should have their own Mutex Protection,
|
||||||
//p3tunnel *mP3tunnel;
|
//p3tunnel *mP3tunnel;
|
||||||
DNSResolver *mDNSResolver ;
|
DNSResolver *mDNSResolver ;
|
||||||
|
|
||||||
|
|
|
@ -277,144 +277,6 @@ int pqihandler::SendRsRawItem(RsRawItem *ns)
|
||||||
return queueOutRsItem(ns) ;
|
return queueOutRsItem(ns) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TO_BE_REMOVED
|
|
||||||
|
|
||||||
// inputs. This is a very basic
|
|
||||||
// system that is completely biased and slow...
|
|
||||||
// someone please fix.
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////
|
|
||||||
// THIS CODE SHOULD BE ABLE TO BE REMOVED!
|
|
||||||
/////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
int pqihandler::locked_GetItems()
|
|
||||||
{
|
|
||||||
std::map<RsPeerId, SearchModule *>::iterator it;
|
|
||||||
|
|
||||||
RsItem *item;
|
|
||||||
int count = 0;
|
|
||||||
|
|
||||||
// loop through modules....
|
|
||||||
for(it = mods.begin(); it != mods.end(); ++it)
|
|
||||||
{
|
|
||||||
SearchModule *mod = (it -> second);
|
|
||||||
|
|
||||||
// check security... is output allowed.
|
|
||||||
if(0 < secpolicy_check((it -> second) -> sp,
|
|
||||||
0, PQI_INCOMING)) // PQI_ITEM_TYPE_ITEM, PQI_INCOMING))
|
|
||||||
{
|
|
||||||
// if yes... attempt to read.
|
|
||||||
while((item = (mod -> pqi) -> GetItem()) != NULL)
|
|
||||||
{
|
|
||||||
|
|
||||||
static int ntimes =0 ;
|
|
||||||
// if(++ntimes < 20)
|
|
||||||
{
|
|
||||||
std::cerr << "pqihandler::locked_GetItems() pqi->GetItem()";
|
|
||||||
std::cerr << " should never happen anymore!";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef RSITEM_DEBUG
|
|
||||||
std::string out;
|
|
||||||
rs_sprintf(out, "pqihandler::GetItems() Incoming Item from: %p\n", mod -> pqi);
|
|
||||||
item -> print_string(out);
|
|
||||||
|
|
||||||
pqioutput(PQL_DEBUG_BASIC,
|
|
||||||
pqihandlerzone, out);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (item->PeerId() != (mod->pqi)->PeerId())
|
|
||||||
{
|
|
||||||
/* ERROR */
|
|
||||||
pqioutput(PQL_ALERT,
|
|
||||||
pqihandlerzone, "ERROR PeerIds dont match!");
|
|
||||||
item->PeerId(mod->pqi->PeerId());
|
|
||||||
}
|
|
||||||
|
|
||||||
locked_SortnStoreItem(item);
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// not allowed to recieve from here....
|
|
||||||
while((item = (mod -> pqi) -> GetItem()) != NULL)
|
|
||||||
{
|
|
||||||
std::string out;
|
|
||||||
rs_sprintf(out, "pqihandler::GetItems() Incoming Item from: %p\n", mod -> pqi);
|
|
||||||
item -> print_string(out);
|
|
||||||
out += "\nItem Not Allowed (Sec Pol). deleting!";
|
|
||||||
|
|
||||||
pqioutput(PQL_DEBUG_BASIC,
|
|
||||||
pqihandlerzone, out);
|
|
||||||
|
|
||||||
delete item;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return count;
|
|
||||||
}
|
|
||||||
|
|
||||||
void pqihandler::locked_SortnStoreItem(RsItem *item)
|
|
||||||
{
|
|
||||||
/* get class type / subtype out of the item */
|
|
||||||
uint8_t vers = item -> PacketVersion();
|
|
||||||
|
|
||||||
/* whole Version reserved for SERVICES/CACHES */
|
|
||||||
if (vers == RS_PKT_VERSION_SERVICE)
|
|
||||||
{
|
|
||||||
pqioutput(PQL_DEBUG_BASIC, pqihandlerzone,
|
|
||||||
"SortnStore -> Service");
|
|
||||||
in_service.push_back(item);
|
|
||||||
item = NULL;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
std::cerr << "pqihandler::locked_SortnStoreItem() : unhandled item! Will be deleted. This is certainly a bug." << std::endl;
|
|
||||||
|
|
||||||
if (vers != RS_PKT_VERSION1)
|
|
||||||
{
|
|
||||||
pqioutput(PQL_DEBUG_BASIC, pqihandlerzone, "SortnStore -> Invalid VERSION! Deleting!");
|
|
||||||
delete item;
|
|
||||||
item = NULL;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item)
|
|
||||||
{
|
|
||||||
pqioutput(PQL_DEBUG_BASIC, pqihandlerzone, "SortnStore -> Deleting Unsorted Item");
|
|
||||||
delete item;
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
RsRawItem *pqihandler::GetRsRawItem()
|
|
||||||
{
|
|
||||||
RsStackMutex stack(coreMtx); /**************** LOCKED MUTEX ****************/
|
|
||||||
|
|
||||||
if (in_service.size() != 0)
|
|
||||||
{
|
|
||||||
RsRawItem *fi = dynamic_cast<RsRawItem *>(in_service.front());
|
|
||||||
if (!fi) { delete in_service.front(); }
|
|
||||||
in_service.pop_front();
|
|
||||||
return fi;
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////
|
|
||||||
// ABOVE CODE SHOULD BE ABLE TO BE REMOVED!
|
|
||||||
/////////////////////////////////////////////////////////////////////////
|
|
||||||
/////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static const float MIN_RATE = 0.01; // 10 B/s
|
|
||||||
|
|
||||||
int pqihandler::ExtractTrafficInfo(std::list<RSTrafficClue>& out_lst,std::list<RSTrafficClue>& in_lst)
|
int pqihandler::ExtractTrafficInfo(std::list<RSTrafficClue>& out_lst,std::list<RSTrafficClue>& in_lst)
|
||||||
{
|
{
|
||||||
in_lst.clear() ;
|
in_lst.clear() ;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue