Skip to content

Allow telnet property-catalog query without a prior HOLD#1480

Merged
bcoconni merged 1 commit into
JSBSim-Team:masterfrom
Zaretto:fix/telnet-get-without-hold
Jun 30, 2026
Merged

Allow telnet property-catalog query without a prior HOLD#1480
bcoconni merged 1 commit into
JSBSim-Team:masterfrom
Zaretto:fix/telnet-get-without-hold

Conversation

@Zaretto

@Zaretto Zaretto commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

The telnet get handler refuses a property-catalog query (a get on a non-leaf node) unless the simulation is already in HOLD, replying Must be in HOLD to search properties. A client therefore has to bracket the lookup with hold and resume.

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, the Resuming line 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.

@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 25.11%. Comparing base (0b99c70) to head (52eca9b).

Files with missing lines Patch % Lines
src/input_output/FGInputSocket.cpp 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.
@Zaretto Zaretto force-pushed the fix/telnet-get-without-hold branch from bd853af to 52eca9b Compare June 23, 2026 12:34
@seanmcleod70

Copy link
Copy Markdown
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 -
15128d6.

@bcoconni bcoconni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@bcoconni bcoconni merged commit d371f38 into JSBSim-Team:master Jun 30, 2026
32 checks passed
@bcoconni

Copy link
Copy Markdown
Member

The PR is merged. Thanks for your contribution @Zaretto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants