1
0
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:
2022-02-13 23:55:30 -06:00
parent a442f2f493
commit e7265ad15b
8 changed files with 69 additions and 20 deletions

View File

@@ -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));
}