checkpt, try to parse packets only once

This commit is contained in:
JackDoan
2026-05-07 11:04:16 -05:00
parent 6cb00c613c
commit 0375aff451
5 changed files with 37 additions and 9 deletions

View File

@@ -348,11 +348,12 @@ func (f *Interface) listenOut(i int) {
lhh := f.lightHouse.NewRequestHandler()
h := &header.H{}
fwPacket := &firewall.Packet{}
parsedRx := &batch.RxParsed{}
nb := make([]byte, 12, 12)
listener := func(fromUdpAddr netip.AddrPort, payload []byte, meta udp.RxMeta) {
plaintext := f.batchers[i].Reserve(len(payload))
f.readOutsidePackets(ViaSender{UdpAddr: fromUdpAddr}, plaintext[:0], payload, h, fwPacket, lhh, nb, i, ctCache.Get(), meta)
f.readOutsidePackets(ViaSender{UdpAddr: fromUdpAddr}, plaintext[:0], payload, h, fwPacket, parsedRx, lhh, nb, i, ctCache.Get(), meta)
}
flusher := func() {