mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-13 23:44:52 +01:00
revert packet concatenation
This commit is contained in:
@@ -154,21 +154,13 @@ func (s *Session) QueueAck(ackHandle uint32, data []byte) {
|
|||||||
|
|
||||||
func (s *Session) sendLoop() {
|
func (s *Session) sendLoop() {
|
||||||
var pkt packet
|
var pkt packet
|
||||||
var buffer []byte
|
|
||||||
for {
|
for {
|
||||||
if s.closed {
|
if s.closed {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for len(s.sendPackets) > 0 {
|
err := s.cryptConn.SendPacket(append(pkt.data, []byte{0x00, 0x10}...))
|
||||||
pkt = <-s.sendPackets
|
if err != nil {
|
||||||
buffer = append(buffer, pkt.data...)
|
s.logger.Warn("Failed to send packet")
|
||||||
}
|
|
||||||
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(time.Duration(_config.ErupeConfig.LoopDelay) * time.Millisecond)
|
time.Sleep(time.Duration(_config.ErupeConfig.LoopDelay) * time.Millisecond)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user