mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-12 15:04:38 +01:00
ignore empty packet buffer
This commit is contained in:
@@ -162,11 +162,13 @@ func (s *Session) sendLoop() {
|
||||
pkt = <-s.sendPackets
|
||||
buffer = append(buffer, pkt.data...)
|
||||
}
|
||||
if len(buffer) > 0 {
|
||||
err := s.cryptConn.SendPacket(append(buffer, []byte{0x00, 0x10}...))
|
||||
if err != nil {
|
||||
s.logger.Warn("Failed to send packet")
|
||||
}
|
||||
buffer = buffer[:0]
|
||||
}
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user