Cleanup / temp buffers for various things
This commit is contained in:
@@ -23,6 +23,10 @@ const (
|
||||
TimeoutInterval = 30 * time.Second
|
||||
)
|
||||
|
||||
// scratchSize is large enough for the biggest buffer either the ping or the
|
||||
// multicast path serializes through the shared App scratch.
|
||||
const scratchSize = max(control.Size, multicast.SignedPacketSize)
|
||||
|
||||
type PingEvent struct {
|
||||
srcVPNIP netip.Addr
|
||||
ping control.Ping
|
||||
@@ -53,8 +57,9 @@ type App struct {
|
||||
selfV4 netip.AddrPort
|
||||
selfV6 netip.AddrPort
|
||||
|
||||
// Reusable scratch for multicast signature verification (event loop only).
|
||||
mcVerifyBuf []byte
|
||||
// Reusable serialization scratch for outgoing pings and multicast signature
|
||||
// verification. Only touched from the Run goroutine.
|
||||
scratch []byte
|
||||
|
||||
// Event channels fed by background goroutines
|
||||
hubAddCh <-chan m.Peer
|
||||
|
||||
Reference in New Issue
Block a user