mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Stack for incoming RsDiscReply items to give RetroShare time to send heartbeats and process other services.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3524 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
077b2871f1
commit
addb330205
@ -168,20 +168,23 @@ int p3disc::handleIncoming()
|
||||
// if discovery reply then respond if haven't already.
|
||||
if (NULL != (dri = dynamic_cast<RsDiscReply *> (item))) {
|
||||
|
||||
recvPeerDetails(dri);
|
||||
nhandled++;
|
||||
// add item to list for later process
|
||||
discReplyList.push_back(dri); // no delete
|
||||
}
|
||||
else if (NULL != (dvi = dynamic_cast<RsDiscVersion *> (item))) {
|
||||
recvPeerVersionMsg(dvi);
|
||||
nhandled++;
|
||||
delete item;
|
||||
}
|
||||
else if (NULL != (inf = dynamic_cast<RsDiscAskInfo *> (item))) /* Ping */ {
|
||||
recvAskInfo(inf);
|
||||
nhandled++;
|
||||
delete item;
|
||||
}
|
||||
else if (NULL != (dta = dynamic_cast<RsDiscHeartbeat *> (item))) {
|
||||
recvHeartbeatMsg(dta);
|
||||
nhandled++ ;
|
||||
delete item;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -190,9 +193,18 @@ int p3disc::handleIncoming()
|
||||
item -> print(std::cerr);
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
delete item;
|
||||
}
|
||||
|
||||
delete item;
|
||||
}
|
||||
|
||||
// process one disc item
|
||||
if (!discReplyList.empty()) {
|
||||
std::cerr << "p3disc::handleIncoming() Count of disc items " << discReplyList.size() << std::endl;
|
||||
RsDiscReply *dri = discReplyList.front();
|
||||
discReplyList.pop_front();
|
||||
recvPeerDetails(dri);
|
||||
nhandled++;
|
||||
delete dri;
|
||||
}
|
||||
|
||||
#ifdef P3DISC_DEBUG
|
||||
|
@ -145,6 +145,8 @@ int idServers();
|
||||
|
||||
std::map<std::string, autoneighbour> neighbours;
|
||||
std::map<std::string, std::string> versions;
|
||||
|
||||
std::list<RsDiscReply*> discReplyList;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user