Update handling of RLVA_VERSION in oc_outfits.lsl#1211
Open
NikkiLacrima wants to merge 1 commit into
Open
Conversation
Call Process() when receiving link message RLVA_VERSION to enable core lock with rlva folder naming conventions.
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Call Process() when receiving link message RLVA_VERSION to enable core lock with rlva folder naming conventions.
The long writeup:
With Outfits / Lock Core setting in oc_outfits, the .core folder does not lock on startup. A cycle of unlock/lock is needed ! Ref #1210.
Mechanism.
Changing g_iLockCore calls Commit() and Commit calls Process() that sets the RLV lock using GetOutfitSystem(TRUE). GetOutfitSystem uses g_iRLVa flag to select the path “.outfits/.core”
Reading LM_SETTING_RESPONSE outfits_lockcore calls Process() as it should.
LinkMessage iNum == RLVA_VERSION sets g_iRLVa flag but does not call Process().
So for this to work iNum == RLVA_VERSION must occur before LM_SETTING_RESPONSE outfits_lockcore, but after switching to state active.
This is a race condition between the initialization of RLV and the sending of LM_SETTING_RESPONSE outfits_lockcore that it seems has usually worked in pre 8.4
The problem.
OC 8.4 sends RLVA_VERSION twice, first when RLV_ON is confirmed, and this has moved to be early, before iNum == STARTUP triggers the state switching. Second is after LM_SETTING_RESPONSE settings=sent and this is after LM_SETTING_RESPONSE outfits_lockcore so Process() is not called with the correct outfit system path (unless g_iLockCore is toggled off/on).
Fix
Several possible ways to fix this.
Make oc_outfits listen for iNum == RLVA_VERSION in default state. Will work as long as RLV system is active before LM_SETTING_RESPONSE outfits_lockcore.
Make LinkMessage iNum == RLVA_VERSION call Process(). This will be done a bit after LM_SETTING_RESPONSE settings=sent
Make oc_rlvsys send the LinkMessage iNum == RLVA_VERSION in response to iNum == STARTUP
This patch implements the second method.