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
Author[]Andy Green <andy@warmcat.com> 2025-08-06 08:43 UTC
Committer[]Andy Green <andy@warmcat.com> 2025-08-06 08:43 UTC
Tree14fa1f426f542b50a679eeaeb1d1fc1a0551230a   Raw Patch
 
sai-web: api v3
sai-web: api v3
diff --git a/assets/sai.js b/assets/sai.js index 949eb57..3f125d1 100644 --- a/assets/sai.js +++ b/assets/sai.js @@ -1,4 +1,4 @@ -const SAI_JS_API_VERSION = 2; +const SAI_JS_API_VERSION = 3; (function() { @@ -1086,11 +1086,11 @@ function ws_open_sai() var u, ci, n; var now_ut = Math.round((new Date().getTime() / 1000)); - console.log(msg.data); + // console.log(msg.data); // if (msg.data.length < 10) // return; jso = JSON.parse(msg.data); - console.log(jso.schema); + // console.log(jso.schema); if (jso.alang) { var a = jso.alang.split(","), n; @@ -1433,7 +1433,12 @@ function ws_open_sai() break; } - // --- NEW, FINAL LOGIC --- + jso.platforms.sort((a, b) => { + if (a.name && b.name) { + return a.name.localeCompare(b.name); + } + return 0; // Don't sort if names are missing + }); // Step 1: Create a map of group keys to group container divs. // Also create a list of standalone platforms. diff --git a/src/builder/b-private.h b/src/builder/b-private.h index e1b15a2..5baa4b3 100644 --- a/src/builder/b-private.h +++ b/src/builder/b-private.h @@ -137,6 +137,7 @@ struct sai_builder { uint64_t last_sys_total; uint64_t last_sys_idle; #elif defined(WIN32) + ULARGE_INTEGER last_sys_total; ULARGE_INTEGER last_sys_idle; ULARGE_INTEGER last_sys_kernel; ULARGE_INTEGER last_sys_user; diff --git a/src/server/s-ws-builder.c b/src/server/s-ws-builder.c index f88a571..6266a0d 100644 --- a/src/server/s-ws-builder.c +++ b/src/server/s-ws-builder.c @@ -858,7 +858,7 @@ sais_ws_json_tx_builder(struct vhd *vhd, struct pss *pss, uint8_t *buf, "com.warmcat.sai.viewerstate") }; - lwsl_wsi_notice(pss->wsi, "++++ Sending viewerstate (count: %u) to builder\n", + lwsl_wsi_info(pss->wsi, "++++ Sending viewerstate (count: %u) to builder\n", vs->viewers); js = lws_struct_json_serialize_create(lsm_schema_viewerstate, diff --git a/src/web/w-comms.c b/src/web/w-comms.c index 6c8a505..87cb552 100644 --- a/src/web/w-comms.c +++ b/src/web/w-comms.c @@ -1038,6 +1038,7 @@ clean_spa: return -1; } +#if 0 { const unsigned char *c; @@ -1068,9 +1069,7 @@ clean_spa: n++; } while (c); } - - - lwsl_wsi_warn(wsi, "ESTABLISHED"); +#endif /* * What's the situation with a JWT cookie? Normal users won't @@ -1103,6 +1102,11 @@ clean_spa: pss->alang[0] = '\0'; lws_hdr_copy(wsi, pss->alang, sizeof(pss->alang), WSI_TOKEN_HTTP_ACCEPT_LANGUAGE); + buf[0] = '\0'; + lws_hdr_copy(wsi, (char *)buf, sizeof(buf), + WSI_TOKEN_X_FORWARDED_FOR); + + lwsl_wsi_warn(wsi, "ESTABLISHED: %s %s", (char *)buf, pss->alang); if (lws_hdr_total_length(wsi, WSI_TOKEN_GET_URI)) { if (lws_hdr_copy(wsi, (char *)start, 64, diff --git a/src/web/w-private.h b/src/web/w-private.h index 884a6c2..97281bb 100644 --- a/src/web/w-private.h +++ b/src/web/w-private.h @@ -23,7 +23,7 @@ #include <sqlite3.h> #include <sys/stat.h> -#define SAIW_API_VERSION 2 +#define SAIW_API_VERSION 3 struct sai_plat;
Page fetched 0s ago, creation time: 5ms (vhost etag hits: 0%, cache hits: 0%)