Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

Commit 27f8f90

Browse files
committed
router: tell goroutine to exit when forwarder is stopped
Otherwise a goroutine is leaked each time a connection is closed.
1 parent 9be65b4 commit 27f8f90

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

router/overlay_switch.go

+1
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ func (fwd *overlaySwitchForwarder) Stop() {
452452
fwd.lock.Lock()
453453
defer fwd.lock.Unlock()
454454
fwd.stopFrom(0)
455+
close(fwd.stopChan)
455456
}
456457

457458
func (fwd *overlaySwitchForwarder) ControlMessage(tag byte, msg []byte) {

0 commit comments

Comments
 (0)