Allow telnet property-catalog query without a prior HOLD#1480
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1480 +/- ##
=======================================
Coverage 25.10% 25.11%
=======================================
Files 171 171
Lines 18843 18839 -4
=======================================
Hits 4731 4731
+ Misses 14112 14108 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The telnet 'get' handler refused a property-catalog query unless the simulation was already in HOLD, forcing a client to bracket the lookup with 'hold' and 'resume'. That is awkward to script: every reply is terminated by a 'JSBSim> ' prompt and nothing is length framed, so a client must read to each of the three prompts in lockstep. The variable-length catalog reply sits between them, and any mis-step runs the catalog output, the 'Resuming' line and the next prompt together. The bracket also pauses the simulation for what is only a read-only lookup. The property catalog is a static list that does not depend on the simulation state, so holding served no purpose. Remove the restriction and answer the query directly, reducing the exchange to a single command and a single prompt.
bd853af to
52eca9b
Compare
Contributor
|
Yep, it's not clear what the reason for the HOLD requirement was, it looks like the code was added way back in 2005 - |
Member
|
The PR is merged. Thanks for your contribution @Zaretto |
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.
The telnet
gethandler refuses a property-catalog query (ageton a non-leaf node) unless the simulation is already in HOLD, replyingMust be in HOLD to search properties. A client therefore has to bracket the lookup withholdandresume.This is a genuine obstacle to driving the telnet interface from another program. Every reply is terminated by a
JSBSim>prompt and nothing is length framed, so a client must read to each of the three prompts in lockstep. The variable-length catalog reply sits between them; any mis-step runs the catalog output, theResumingline and the next prompt together. The bracket also pauses the simulation for what is only a read-only lookup.AFAICT the property catalog is a static list that does not depend on the simulation state so I'm not quite clear why we have to be in HOLD to return this. Maybe it was originally due to performance of building or sending a large list over TCP/IP.
My proposed solution is to answers the query directly thus streamlining the exchange to a single command.