Fix panic when closing downstream connection

This commit is contained in:
Simon Ser 2020-02-18 15:08:06 +01:00
parent 1f5a72a7cf
commit 9fea758956
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

View File

@ -166,6 +166,7 @@ func (dc *downstreamConn) Close() error {
for i := range u.downstreamConns { for i := range u.downstreamConns {
if u.downstreamConns[i] == dc { if u.downstreamConns[i] == dc {
u.downstreamConns = append(u.downstreamConns[:i], u.downstreamConns[i+1:]...) u.downstreamConns = append(u.downstreamConns[:i], u.downstreamConns[i+1:]...)
break
} }
} }
u.lock.Unlock() u.lock.Unlock()