Fix: shared-host respawn block and web login brand placeholder

Two unrelated fixes bundled here.

1. Client respawn (ClientDll.cpp EasyRun/Run, test.cpp Run): after a host
   is shared or transferred to another server, restarting the master
   (server A) left the host's main instance stuck, because the respawn
   loop waited on IsStoped() (g_bThreadExit && GetCount()==0), which never
   becomes true while a still-alive shared instance holds AddCount(1).
   S_SERVER_EXIT now triggers an immediate reconnect without waiting for
   shared instances; client-exit / update still waits for all instances to
   drain. Verified by 100 restart cycles.

2. Web login page (WebService.cpp): the MFC web server only substituted
   __BASE_PATH__ in index.html and left __BRAND_NAME__ as a literal token
   in the login page title/heading. Substitute it with "SimpleRemoter" to
   match the original branding and the Go server's default.

Co-Authored-By: deepseek-v4-pro
This commit is contained in:
yuanyuanxianganddeepseek-v4-pro committed 2026-10-16 21:08:42 +02:00
1 parent e5f5720867
commit 33986f4893
3 files changed
+19 -12

No files matched your search

+5
View File
@@ -245,6 +245,11 @@ void CWebService::ServerThread(int port) {
// server's subpath deployment. The MFC server serves from the domain root,
// so strip it (→ "") — otherwise the WebSocket/CSS/JS URLs break.
ReplaceAll(cachedHtml, "__BASE_PATH__", "");
// server/web/index.html also carries a __BRAND_NAME__ placeholder for the
// white-label title. The Go server swaps it at serve time (defaulting to
// "SimpleRemoter"); the MFC server does the same here, otherwise the login
// page shows the literal "__BRAND_NAME__" token as <title>/<h1>.
ReplaceAll(cachedHtml, "__BRAND_NAME__", "SimpleRemoter");
// Log loaded size; zero bytes means the RC BINARY resource is missing or
// server/web/index.html was not embedded — check 2015Remote.rc and rebuild.
Mprintf("[WebService] index.html loaded: %zu bytes\n", cachedHtml.size());