server: do not advertise a connect code without the tunnel

--connect-code on its own had no effect other than being served in
/props, so the Web UI showed a remote access code that no tunnel was
serving. Clear it when --connect is off, and say so once at startup.

The teardown comment claimed that terminate() closes the child stdout.
It does not: the log thread leaves fgets() only once every writer of
that pipe is gone, so a descendant of llama-connect would block the
join forever. Describe the real contract instead.

Also restore the --reasoning-preserve default in the generated docs.
This commit is contained in:
Pascal
2026-09-03 10:12:11 +02:00
parent a75348a2ae
commit a2ec6b0fff
5 changed files with 10 additions and 4 deletions
+4
View File
@@ -184,6 +184,10 @@ int llama_server(common_params & params, int argc, char ** argv) {
return 1;
}
params.server_connect_code = server_connect::resolve_code(params.server_connect_code);
} else if (!params.server_connect_code.empty()) {
// the code is only meaningful while the tunnel runs, and /props keys off it being set
SRV_WRN("%s", "--connect-code is ignored without --connect\n");
params.server_connect_code.clear();
}
// note: this is guaranteed to out-live ctx_http and tools