send: better debug message for failed data packet

This commit is contained in:
Jason A. Donenfeld 2018-07-16 16:05:21 +02:00
parent 6b3b1c3b91
commit 2e13b7b0fb

View File

@ -521,6 +521,7 @@ func (peer *Peer) RoutineSequentialSender() {
device := peer.device device := peer.device
logDebug := device.log.Debug logDebug := device.log.Debug
logError := device.log.Error
defer func() { defer func() {
logDebug.Println(peer, "- Routine: sequential sender - stopped") logDebug.Println(peer, "- Routine: sequential sender - stopped")
@ -557,7 +558,7 @@ func (peer *Peer) RoutineSequentialSender() {
err := peer.SendBuffer(elem.packet) err := peer.SendBuffer(elem.packet)
device.PutMessageBuffer(elem.buffer) device.PutMessageBuffer(elem.buffer)
if err != nil { if err != nil {
logDebug.Println("Failed to send authenticated packet to peer", peer) logError.Println(peer, "- Failed to send data packet", err)
continue continue
} }
atomic.AddUint64(&peer.stats.txBytes, length) atomic.AddUint64(&peer.stats.txBytes, length)