mirror of
https://github.com/slackhq/nebula.git
synced 2025-12-30 10:38:28 +01:00
small simplification
This commit is contained in:
@@ -220,8 +220,8 @@ func (u *StdConn) Prep(pkt *packet.Packet, addr netip.AddrPort) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
pkt.ReadyToSend = true
|
||||
pkt.Name = pkt.Name[:nl]
|
||||
pkt.OutLen = len(pkt.Payload)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ func (u *StdConn) WriteBatch(pkts []*packet.Packet) (int, error) {
|
||||
//segmenting := false
|
||||
idx := 0
|
||||
for _, pkt := range pkts {
|
||||
if len(pkt.Payload) == 0 || pkt.OutLen == -1 {
|
||||
if !pkt.ReadyToSend || len(pkt.Payload) == 0 {
|
||||
sent++
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user