1
0
mirror of https://github.com/CPunch/Laika.git synced 2026-02-05 07:50: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

@@ -109,6 +109,9 @@ void laikaP_rmvSock(struct sLaika_pollList *pList, struct sLaika_socket *sock) {
}
void laikaP_addPollOut(struct sLaika_pollList *pList, struct sLaika_socket *sock) {
if (sock->setPollOut)
return;
#ifdef LAIKA_USE_EPOLL
pList->ev.events = EPOLLIN | EPOLLOUT;
pList->ev.data.ptr = (void*)sock;
@@ -127,9 +130,14 @@ void laikaP_addPollOut(struct sLaika_pollList *pList, struct sLaika_socket *sock
}
}
#endif
sock->setPollOut = true;
}
void laikaP_rmvPollOut(struct sLaika_pollList *pList, struct sLaika_socket *sock) {
if (!sock->setPollOut)
return;
#ifdef LAIKA_USE_EPOLL
pList->ev.events = EPOLLIN;
pList->ev.data.ptr = (void*)sock;
@@ -148,6 +156,8 @@ void laikaP_rmvPollOut(struct sLaika_pollList *pList, struct sLaika_socket *sock
}
}
#endif
sock->setPollOut = false;
}
void laikaP_pushOutQueue(struct sLaika_pollList *pList, struct sLaika_socket *sock) {