1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-12-26 01:05:48 +01:00

Don't attempt to replace empty connection in disk writer.

This commit is contained in:
Juliusz Chroboczek 2021-02-04 22:01:41 +01:00
parent b4240c4505
commit c72cbe8f27

View file

@ -105,12 +105,14 @@ func (client *Client) PushConn(g *group.Group, id string, up conn.Up, tracks []c
return errors.New("disk client is closed")
}
rp := client.down[replace]
if rp != nil {
rp.Close()
delete(client.down, replace)
} else {
log.Printf("Replacing unknown connection")
if replace != "" {
rp := client.down[replace]
if rp != nil {
rp.Close()
delete(client.down, replace)
} else {
log.Printf("Disk writer: replacing unknown connection")
}
}
old := client.down[id]