Commit 7b75eaaf authored by jan.koester's avatar jan.koester
Browse files

test

parent 34502802
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -334,7 +334,14 @@ namespace netplus {
                        if ((events & EPOLLIN) && !needClose) {
                            try {
                                buffer primeBuf(BLOCKSIZE);
                                c->slots[0].csock->prime_recv(primeBuf, 0);
                                size_t n = c->slots[0].csock->prime_recv(primeBuf, 0);
                                if (n > 0) {
                                    // Handshake bytes count as progress too -- a slow
                                    // multi-round-trip TLS handshake shouldn't look idle
                                    // to reapIdleConnections() just because it hasn't
                                    // reached application data yet.
                                    c->lasteventime = time(nullptr);
                                }
                            } catch (NetException& e) {
                                if (e.getErrorType() != NetException::Note) throw;
                            }
@@ -349,6 +356,7 @@ namespace netplus {
                            if (c->slots[0].csock->hasPendingWrite()) {
                                try {
                                    c->slots[0].csock->flush_out();
                                    c->lasteventime = time(nullptr);
                                } catch (NetException& e) {
                                    if (e.getErrorType() == NetException::Note) {
                                        rearm.disarm();
+8 −0
Original line number Diff line number Diff line
@@ -471,6 +471,11 @@ namespace netplus {
                                reinterpret_cast<const uint8_t*>(buf->data.buf),
                                bytes
                            );
                            // Handshake bytes count as progress too -- a slow
                            // multi-round-trip TLS handshake shouldn't look idle
                            // to reapIdleConnections() just because it hasn't
                            // reached application data yet.
                            owner->lasteventime = time(nullptr);
                        }

                        if (!ok) {
@@ -622,6 +627,9 @@ namespace netplus {
                        if (!owner->slots[0].csock->getHandshakeDone()) {
                            owner->slots[0].WritePending.store(false);
                            owner->slots[0].csock->setPendingWrite(false);
                            // Handshake bytes count as progress too -- see the OP_READ
                            // side's identical comment above.
                            owner->lasteventime = time(nullptr);

                            std::lock_guard<std::recursive_mutex> hsLock(owner->event_mutex);

+9 −1
Original line number Diff line number Diff line
@@ -486,7 +486,14 @@ namespace netplus {
                            recvBuf.size = BLOCKSIZE;
                            try {
                                size_t n = c->slots[0].csock->prime_recv(recvBuf, 0);
                                if (n > 0) gotRawData = true;
                                if (n > 0) {
                                    gotRawData = true;
                                    // Handshake bytes count as progress too -- a slow
                                    // multi-round-trip TLS handshake shouldn't look idle
                                    // to reapIdleConnections() just because it hasn't
                                    // reached application data yet.
                                    c->lasteventime = time(nullptr);
                                }
                            } catch (NetException& e) {
                                if (e.getErrorType() != NetException::Note) throw;
                            }
@@ -501,6 +508,7 @@ namespace netplus {
                            if (c->slots[0].csock->hasPendingWrite()) {
                                try {
                                    c->slots[0].csock->flush_out();
                                    c->lasteventime = time(nullptr);
                                } catch (NetException& e) {
                                    if (e.getErrorType() == NetException::Note) {
                                        // Guard auto-detects hasPendingWrite and arms WRITE