Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
    npro  
 Modern all-safe Rust Network Protocol library supporting h1, h2, h3, ws, wt sans-IO and with socket IO + tls
git clone https://npro.rs/repo/npro
 
root / scripts / sai-web.service
Author[]google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.c...> 2025-11-30 15:50 UTC
Committer[]Andy Green <andy@warmcat.com> 2025-11-30 15:52 UTC
Treef26ecef56bbee5c1dce2b788df2760524ac0713a   Raw Patch
 
Refactor PCON creation logic and update sai-power
Refactor PCON creation logic and update sai-power

- Extracted `saip_pcon_create` from `p-conf.c` to `p-utils.c` for reuse.
- Updated `p-sai.c` to dynamically create PCONs if a builder registers with an unknown PCON name, logging a warning.
- This ensures builders can register even if `sai-power` configuration is missing the PCON definition, improving robustness against configuration mismatches.
diff --git a/src/power/p-ws-server.c b/src/power/p-ws-server.c index 05ed85e..107511d 100644 --- a/src/power/p-ws-server.c +++ b/src/power/p-ws-server.c @@ -168,7 +168,14 @@ saip_m_rx(void *userobj, const uint8_t *buf, size_t len, int flags) __func__, sb->name, pc->name); /* Update PCON stay state */ pc->manual_stay = stay->stay_on; - saip_pcon_start_check(); + + /* If stay is cleared, schedule power off check */ + if (!stay->stay_on) + saip_pcon_start_check(); + else { + /* If stay is set, ensure it is on immediately */ + saip_switch(pc, 1); + } goto found; } } lws_end_foreach_dll(b_node);
Page fetched 0s ago, creation time: 2ms (vhost etag hits: 0%, cache hits: 0%)