mirror of
https://github.com/tim-beatham/smegmesh.git
synced 2024-12-04 13:43:19 +01:00
main
- Ready for presentation
This commit is contained in:
parent
41d41694a6
commit
915263e49a
@ -143,14 +143,13 @@ func (m *ConnectionManagerImpl) RemoveConnection(endPoint string) error {
|
||||
m.conLoc.Lock()
|
||||
connection, ok := m.clientConnections[endPoint]
|
||||
|
||||
if !ok {
|
||||
// nothing to do if no connection
|
||||
return nil
|
||||
var err error
|
||||
|
||||
if ok {
|
||||
err = connection.Close()
|
||||
delete(m.clientConnections, endPoint)
|
||||
}
|
||||
|
||||
err := connection.Close()
|
||||
|
||||
delete(m.clientConnections, endPoint)
|
||||
m.conLoc.Unlock()
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user