Skip to content

fix(srtla_send): apply the --config toml file - #21

Merged
datagutt merged 1 commit into
mainfrom
fix/toml-config
Sep 24, 2026
Merged

datagutt merged 1 commit into
mainfrom
fix/toml-config

Conversation

@datagutt

Copy link
Copy Markdown
Member

--config loaded the TOML file, debug-logged it and dropped it. No key has ever taken effect. CodeRabbit flagged this on #18, which adds two more keys to the same dead path.

Changes

  • Values from the file now fill every option not typed on the command line. The precedence is command line, then file, then default. The code uses clap's value_source, so a typed flag wins even when its value equals the default.
  • The schema is cut to the six keys that map to a flag: mode, no_quality, no_stall_deselect, stall_min_in_flight, stall_ack_stale_ms, conn_timeout_ms. The other eight keys had no target. Some were core constants, and others belonged to features that have since been removed.
  • deny_unknown_fields is set, and a load or parse error now stops startup. Before, the loader fell back to defaults. A config file that still uses a removed key now fails loudly instead of silently doing nothing.
  • The "reloaded on SIGHUP" claim is gone from the --config help, the module doc and the README. SIGHUP only reloads the IP list. Use JSON-RPC to change settings at runtime.

Review notes

  • Start with Cli::apply_config_file in src/main.rs. The fill! macro relies on clap derive using the field name as the arg id.
  • Behavior change: a deployed config file with a retired key (for example switch_hysteresis) now stops startup with an error that lists the valid keys. Such files never did anything before.
  • reconnect: retry at housekeeping cadence before backing off (match C srtla_send) #18 should rebase onto this and add its two keys to TomlConfig and to the fill! list.

--config loaded the file, debug-logged it and dropped it, so no key ever
took effect. Keys set in the file now fill every option not typed on the
command line (command line, then file, then default).

The schema now holds only the six keys that map to a flag. The other
eight had nothing to feed: core constants or removed features. Unknown
keys and parse errors now stop startup rather than falling back to
defaults, so a stale file fails loudly instead of doing nothing.

The file is read once at startup; the "reloaded on SIGHUP" claim was
never true and is gone. Runtime changes go through JSON-RPC.
@coderabbitai

coderabbitai Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 57 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: irlserver/srtla_send/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: a6984d61-cdba-4190-b3d4-4ffd8ebe8228

📥 Commits

Reviewing files that changed from the base of the PR and between 4802637 and 2063034.

📒 Files selected for processing (3)
  • README.md
  • src/main.rs
  • src/toml_config.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@datagutt
datagutt merged commit 9ef77bb into main Sep 24, 2026
5 of 6 checks passed
@datagutt
datagutt deleted the fix/toml-config branch September 24, 2026 09:59
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.

1 participant