@samitouri / QOSami-HFS / commits / 398339dc

fix: (regression 3.1.0) admin/options: changing the port caused "server unreachable" instead of a redirect

Massimo Melina committed May 12, 2026 at 14:51 UTC 398339dc1c15a6cf2f8878c5f827051447e58a79
1 file changed +3 -2
src/listen.ts
+3 -2
@@ -23,7 +23,7 @@ import { defaultBaseUrl } from './nat'
23 import { storedMap } from './persistence'
24 import { argv } from './argv'
25 import { consoleHint } from './consoleLog'
26 -import { onProcessExit } from './first'
26 +import { onProcessExit, quitting } from './first'
27
28 interface ServerExtra { name: string, error?: string, busy?: Promise<string> }
29 let httpSrv: undefined | http.Server & ServerExtra
@@ -279,7 +279,8 @@ export function stopServer(srv?: http.Server) {
279 console.debug("Failed to stop server", String(err))
280 resolve(err)
281 })
282 - srv.closeAllConnections()
282 + if (quitting)
283 + srv.closeAllConnections()
284 })
285 }
286