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
16e9db0567d8cff5ba25551e955319ed269983e0
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
import { fileAttrDb } from './fileAttr'
28
29
interface ServerExtra { name: string, error?: string, busy?: Promise<string> }
@@ -280,7 +280,8 @@ export function stopServer(srv?: http.Server) {
280
console.debug("Failed to stop server", String(err))
281
resolve(err)
282
})
283
- srv.closeAllConnections()
283
+ if (quitting)
284
+ srv.closeAllConnections()
285
})
286
}
287