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 / src / server / s-findings.c
Author[]Andy Green <andy@warmcat.com> 2025-05-30 08:10 UTC
Committer[]Andy Green <andy@warmcat.com> 2025-05-30 08:10 UTC
Treec5f3ebac295ca27823444e4d388e4ccc1e85f87b   Raw Patch
 
power-on: dump stderr/out to log from root process
power-on: dump stderr/out to log from root process
diff --git a/src/power/p-sai.c b/src/power/p-sai.c index d6eef2d..95cd597 100644 --- a/src/power/p-sai.c +++ b/src/power/p-sai.c @@ -154,10 +154,32 @@ static const char * const default_ss_policy = "]}" ; +static int +callback_std(struct lws *wsi, enum lws_callback_reasons reason, void *user, + void *in, size_t len) +{ + uint8_t buf[128]; + ssize_t amt; + + switch (reason) { + case LWS_CALLBACK_RAW_RX_FILE: + amt = read(lws_get_socket_fd(wsi), buf, sizeof(buf)); + /* the string we're getting has the CR on it already */ + lwsl_warn("%s: %.*s", __func__, (int)amt, buf); + return 0; + default: + break; + } + return lws_callback_http_dummy(wsi, reason, user, in, len); +} + +static const struct lws_protocols protocol_std = + { "protocol_std", callback_std, 0, 0 }; static const struct lws_protocols *pprotocols[] = { // &protocol_ws_power, + &protocol_std, NULL }; static void @@ -610,6 +632,7 @@ int main(int argc, const char **argv) info.exec_array = ea; info.max_log_lines = 100; info.opaque = (void *)&power.wol_nspawn; + info.protocol_name = "protocol_std"; lsp_wol = lws_spawn_piped(&info); if (!lsp_wol)
Page fetched 0s ago, creation time: 1ms (vhost etag hits: 0%, cache hits: 0%)