Commit c72cbe8f authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

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

parent b4240c45
...@@ -105,12 +105,14 @@ func (client *Client) PushConn(g *group.Group, id string, up conn.Up, tracks []c ...@@ -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") return errors.New("disk client is closed")
} }
rp := client.down[replace] if replace != "" {
if rp != nil { rp := client.down[replace]
rp.Close() if rp != nil {
delete(client.down, replace) rp.Close()
} else { delete(client.down, replace)
log.Printf("Replacing unknown connection") } else {
log.Printf("Disk writer: replacing unknown connection")
}
} }
old := client.down[id] old := client.down[id]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment