فهرست منبع

On second thought, don't close send queues when expiring.

Could panic if a sender is holding on to the channel.
David Fifield 6 سال پیش
والد
کامیت
37b64f1825
1فایلهای تغییر یافته به همراه1 افزوده شده و 2 حذف شده
  1. 1 2
      turbotunnel/clientmap.go

+ 1 - 2
turbotunnel/clientmap.go

@@ -75,8 +75,7 @@ type clientMapInner struct {
 // than timeout in the past.
 // than timeout in the past.
 func (inner *clientMapInner) removeExpired(now time.Time, timeout time.Duration) {
 func (inner *clientMapInner) removeExpired(now time.Time, timeout time.Duration) {
 	for len(inner.byAge) > 0 && now.Sub(inner.byAge[0].LastSeen) >= timeout {
 	for len(inner.byAge) > 0 && now.Sub(inner.byAge[0].LastSeen) >= timeout {
-		record := heap.Pop(inner).(*clientRecord)
-		close(record.SendQueue)
+		heap.Pop(inner)
 	}
 	}
 }
 }