Commit 2774203d authored by jan.koester's avatar jan.koester
Browse files

test

parent 8d8db9b6
Loading
Loading
Loading
Loading
+3 −12
Changes for src/event/epoll.cpp: 3 added lines, 12 removed lines.
Original line number Diff line number Diff line
@@ -93,8 +93,7 @@ namespace netplus {
        int _Timeout;
    };

    // RAII Rearm (EPOLLONESHOT) - more efficient than level-triggered
    // Since we batch send operations, re-arming syscalls are amortized
    // RAII Rearm (EPOLLONESHOT) - manages re-arming on scope exit
    class EpollArmGuard {
    public:
        EpollArmGuard(int fd, std::shared_ptr<con> c, pollapi* pptr)
@@ -104,21 +103,13 @@ namespace netplus {
            if (!_armed) return;
            if (!_con || !_con->csock) return;

            int next = EPOLLRDHUP | EPOLLONESHOT;
            int next = EPOLLRDHUP | EPOLLIN | EPOLLONESHOT;

            // during handshake => need IN, and OUT only if pending writes
            if (!_con->csock->getHandshakeDone()) {
                next |= EPOLLIN;
                if (_con->csock->hasPendingWrite())
                    next |= EPOLLOUT;
            } else {
                next |= EPOLLIN;
            // Check if we have pending writes or buffered data
            if (_con->SendData.pos < _con->SendData.size() || _con->csock->hasPendingWrite())
                next |= EPOLLOUT;
                // If TLS has buffered data, trigger EPOLLOUT to force a wakeup
            if (_con->csock->hasBufferedData())
                next |= EPOLLOUT;
            }

            try {
                _pptr->setpollEventsFd(_fd, next);