Loading src/quic.cpp +2 −3 Changes for src/quic.cpp: 2 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -2454,11 +2454,10 @@ size_t quic::recvData(buffer& data, int flags) { void quic::pumpNetwork(int flags) { int recv_flags = (flags & MSG_DONTWAIT) ? MSG_DONTWAIT : 0; buffer recv_buf(65535); size_t recv_len = udp::recvData(recv_buf, recv_flags); size_t recv_len = udp::recvData(_pump_buf, recv_flags); if (recv_len > 0) { std::lock_guard<std::mutex> lock(_quic_mutex); processIncomingPacket(reinterpret_cast<const uint8_t*>(recv_buf.data.buf), recv_len); processIncomingPacket(reinterpret_cast<const uint8_t*>(_pump_buf.data.buf), recv_len); // Flush pending flow control frames so the peer doesn't stall if (_handshake_complete && _conn_state.load() == ConnectionState::Connected) { Loading src/socket.h +3 −0 Changes for src/socket.h: 3 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -880,6 +880,9 @@ namespace netplus { bool _need_initial_ack = false; bool _need_handshake_ack = false; // Persistent receive buffer for pumpNetwork() to avoid 65KB alloc/free per call buffer _pump_buf{65535}; // Mutex for thread safety mutable std::mutex _quic_mutex; Loading Loading
src/quic.cpp +2 −3 Changes for src/quic.cpp: 2 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -2454,11 +2454,10 @@ size_t quic::recvData(buffer& data, int flags) { void quic::pumpNetwork(int flags) { int recv_flags = (flags & MSG_DONTWAIT) ? MSG_DONTWAIT : 0; buffer recv_buf(65535); size_t recv_len = udp::recvData(recv_buf, recv_flags); size_t recv_len = udp::recvData(_pump_buf, recv_flags); if (recv_len > 0) { std::lock_guard<std::mutex> lock(_quic_mutex); processIncomingPacket(reinterpret_cast<const uint8_t*>(recv_buf.data.buf), recv_len); processIncomingPacket(reinterpret_cast<const uint8_t*>(_pump_buf.data.buf), recv_len); // Flush pending flow control frames so the peer doesn't stall if (_handshake_complete && _conn_state.load() == ConnectionState::Connected) { Loading
src/socket.h +3 −0 Changes for src/socket.h: 3 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -880,6 +880,9 @@ namespace netplus { bool _need_initial_ack = false; bool _need_handshake_ack = false; // Persistent receive buffer for pumpNetwork() to avoid 65KB alloc/free per call buffer _pump_buf{65535}; // Mutex for thread safety mutable std::mutex _quic_mutex; Loading