Ensure turbotunnel read and write loop terminate

Introduce a waitgroup and done channel to ensure that both the read and
write gorouting for turbotunnel connections terminate when the
connection is closed.
This commit is contained in:
Cecylia Bocovich 2021-05-12 09:32:07 -04:00
parent 11f0846264
commit 7c9005bed3
2 changed files with 27 additions and 14 deletions

View file

@ -140,5 +140,6 @@ func (inner *clientMapInner) Pop() interface{} {
inner.byAge = inner.byAge[:n-1]
// Remove from byAddr map.
delete(inner.byAddr, record.Addr)
close(record.SendQueue)
return record
}