mirror of
https://github.com/slackhq/nebula.git
synced 2026-11-15 08:16:52 +01:00
udp: Fold buffer handoff into ListenOut
This commit is contained in:
1 parent
1fb77bdda5
commit
06035252b2
12 files changed
+45
-60
No files matched your search
+4
-4
@@ -10,10 +10,10 @@ import (
|
||||
"github.com/slackhq/nebula/udp"
|
||||
)
|
||||
|
||||
// handoffConn is a udp conn that can hand each received batch over. The callback returns replacement buffers in the
|
||||
// conn's HandoffShape.
|
||||
// handoffConn is a udp conn that receives in batches of a fixed shape, so staged receive can have replacement buffers
|
||||
// ready for every batch it keeps.
|
||||
type handoffConn interface {
|
||||
ListenOutHandoff(udp.EncReader, func([][]byte) [][]byte) error
|
||||
ListenOut(udp.EncReader, func([][]byte) [][]byte) error
|
||||
HandoffShape() (n, size int)
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ func (p *stagedRx) listen(li handoffConn) error {
|
||||
}
|
||||
}
|
||||
defer p.close()
|
||||
return li.ListenOutHandoff(p.deliver, p.handoff)
|
||||
return li.ListenOut(p.deliver, p.handoff)
|
||||
}
|
||||
|
||||
// deliver is the listener's per-packet work: classify the packet and add it to the current batch. Nothing here
|
||||
|
||||
Reference in new issue
Block a user