Prevent Deadlock when Logging Protocol Engine Stopped
continuous-integration/drone/push Build is pending Details
continuous-integration/drone/pr Build is pending Details

This commit is contained in:
Sarah Jamie Lewis 2021-11-26 16:01:58 -08:00
parent e96d31302c
commit 8763be1230
1 changed files with 2 additions and 1 deletions

View File

@ -916,7 +916,8 @@ func (cp *cwtchPeer) eventHandler() {
case event.ProtocolEngineStopped:
cp.mutex.Lock()
cp.listenStatus = false
log.Infof("Protocol engine for %v has stopped listening", cp.GetOnion())
onion, _ := cp.storage.LoadProfileKeyValue(TypeAttribute, attr.PublicScope.ConstructScopedZonedPath(attr.ProfileZone.ConstructZonedPath(constants.Onion)).ToString())
log.Infof("Protocol engine for %s has stopped listening", onion)
cp.mutex.Unlock()
case event.EncryptedGroupMessage: