From df1239b054aee0c124193daff5e6f3f0b231af34 Mon Sep 17 00:00:00 2001 From: Arceliar Date: Wed, 25 Nov 2020 02:44:13 -0600 Subject: [PATCH] attempting to debug/fix a possible goroutine leak --- src/yggdrasil/link.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/yggdrasil/link.go b/src/yggdrasil/link.go index 5222644b..779c435d 100644 --- a/src/yggdrasil/link.go +++ b/src/yggdrasil/link.go @@ -460,9 +460,6 @@ func (intf *link) notifyStalled() { // reset the close timer func (intf *link) notifyReading() { intf.Act(&intf.reader, func() { - if intf.closeTimer != nil { - intf.closeTimer.Stop() - } intf.closeTimer = time.AfterFunc(closeTime, func() { intf.msgIO.close() }) }) } @@ -470,6 +467,7 @@ func (intf *link) notifyReading() { // wake up the link if it was stalled, and (if size > 0) prepare to send keep-alive traffic func (intf *link) notifyRead(size int) { intf.Act(&intf.reader, func() { + intf.closeTimer.Stop() if intf.stallTimer != nil { intf.stallTimer.Stop() intf.stallTimer = nil