Commit 3144f512 authored by jan.koester's avatar jan.koester
Browse files

test

parent 6db34435
Loading
Loading
Loading
Loading
+5 −2
Changes for src/event/kqueue.cpp: 5 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -413,6 +413,9 @@ namespace netplus {

            KqueueArmGuard rearm(fd, c, &_batch);
            bool needClose = false;
            // Pre-allocate buffer outside the lock to avoid
            // repeated 16 KB heap allocs in the inner loops.
            buffer recvBuf(BLOCKSIZE);

            {
                std::lock_guard<std::mutex> lk(c->event_mutex);
@@ -439,9 +442,9 @@ namespace netplus {
                        // and TLS handshake phases.
                        bool gotRawData = false;
                        {
                            buffer buf(BLOCKSIZE);
                            recvBuf.size = BLOCKSIZE;
                            try {
                                size_t n = c->csock->prime_recv(buf, 0);
                                size_t n = c->csock->prime_recv(recvBuf, 0);
                                if (n > 0) gotRawData = true;
                            } catch (NetException& e) {
                                if (e.getErrorType() != NetException::Note) throw;