Do not send keepalive if closed
This commit is contained in:
parent
27091c3284
commit
cf161f270e
2
send.go
2
send.go
@ -107,7 +107,7 @@ func addToEncryptionQueue(
|
|||||||
/* Queues a keepalive if no packets are queued for peer
|
/* Queues a keepalive if no packets are queued for peer
|
||||||
*/
|
*/
|
||||||
func (peer *Peer) SendKeepalive() bool {
|
func (peer *Peer) SendKeepalive() bool {
|
||||||
if len(peer.queue.nonce) != 0 || peer.queue.packetInNonceQueueIsAwaitingKey {
|
if len(peer.queue.nonce) != 0 || peer.queue.packetInNonceQueueIsAwaitingKey || !peer.isRunning.Get() {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
elem := peer.device.NewOutboundElement()
|
elem := peer.device.NewOutboundElement()
|
||||||
|
Loading…
Reference in New Issue
Block a user