mirror of
https://github.com/tim-beatham/smegmesh.git
synced 2025-06-25 22:41:24 +02: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()
|
m.conLoc.Lock()
|
||||||
connection, ok := m.clientConnections[endPoint]
|
connection, ok := m.clientConnections[endPoint]
|
||||||
|
|
||||||
if !ok {
|
var err error
|
||||||
// nothing to do if no connection
|
|
||||||
return nil
|
if ok {
|
||||||
|
err = connection.Close()
|
||||||
|
delete(m.clientConnections, endPoint)
|
||||||
}
|
}
|
||||||
|
|
||||||
err := connection.Close()
|
|
||||||
|
|
||||||
delete(m.clientConnections, endPoint)
|
|
||||||
m.conLoc.Unlock()
|
m.conLoc.Unlock()
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user