feat(controller-peers-env-fallback): add the environment-variable reader for the default candidate list (task 1.1)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-10-03 05:12:34 +00:00
parent ab21c1622d
commit 7328b06c53
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
4 changed files with 57 additions and 1 deletions

View file

@ -137,6 +137,17 @@ void xce_reconnect_fini(xce_reconnect_ctx_t* rctx);
*/
int xce_parse_peers(const char* peers_str, xce_cluster_config_t* cfg);
/**
* xce_controller_peers_env() — default controller candidate list from the
* XCE_CONTROLLER_PEERS environment variable.
*
* Returns the variable's value unchanged (same format as --peers, not parsed
* here) when it is set and non-empty; NULL when it is unset or empty, so an
* empty value behaves exactly like an unset one. The returned pointer is
* owned by the process environment; do not free or modify it.
*/
const char* xce_controller_peers_env(void);
/* Test seam: set to non-NULL to override the real connect (unit tests only) */
typedef void* (*xce_connect_fn_t)(const char* host, int port);
void xce_cluster_set_connect_fn(xce_connect_fn_t fn);