1
0
mirror of https://github.com/CPunch/Laika.git synced 2026-02-03 15:10:03 +00:00

Moved setPollIn flag to sLaika_socket from sLaika_peer

This commit is contained in:
2022-03-27 17:32:32 -05:00
parent e2e25f5a49
commit 5ece351025
5 changed files with 18 additions and 10 deletions

View File

@@ -13,7 +13,6 @@ struct sLaika_peer *laikaS_newPeer(struct sLaika_peerPacketInfo *pktTbl, struct
peer->type = PEER_UNKNWN;
peer->osType = OS_UNKNWN;
peer->pktID = LAIKAPKT_MAXNONE;
peer->setPollOut = false;
peer->outStart = -1;
peer->inStart = -1;
peer->useSecure = false;
@@ -238,16 +237,14 @@ bool laikaS_handlePeerOut(struct sLaika_socket *sock) {
switch (laikaS_rawSend(&peer->sock, peer->sock.outCount, &sent)) {
case RAWSOCK_OK: /* we're ok! */
if (peer->setPollOut) { /* if POLLOUT was set, unset it */
laikaP_rmvPollOut(peer->pList, &peer->sock);
peer->setPollOut = false;
}
/* if POLLOUT was set, unset it */
laikaP_rmvPollOut(peer->pList, &peer->sock);
return true;
case RAWSOCK_POLL: /* we've been asked to set the POLLOUT flag */
if (!peer->setPollOut) { /* if POLLOUT wasn't set, set it so we'll be notified whenever the kernel has room :) */
laikaP_addPollOut(peer->pList, &peer->sock);
peer->setPollOut = true;
}
/* if POLLOUT wasn't set, set it so we'll be notified whenever the kernel has room :) */
laikaP_addPollOut(peer->pList, &peer->sock);
return true;
default: /* panic! */
case RAWSOCK_CLOSED: