From 444793a6ac7b1359a88a47b39c4c2e90c1fe5236 Mon Sep 17 00:00:00 2001 From: bptato Date: Thu, 28 Mar 2024 16:17:47 +0100 Subject: fflush() before forks seems like a good idea, especially because CGI uses stdout as the IPC mechanism --- src/loader/cgi.nim | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/loader') diff --git a/src/loader/cgi.nim b/src/loader/cgi.nim index 3e3ec4fc..10809767 100644 --- a/src/loader/cgi.nim +++ b/src/loader/cgi.nim @@ -188,6 +188,8 @@ proc loadCGI*(handle: LoaderHandle; request: Request; cgiDir: seq[string]; contentLen = request.body.get.len elif request.multipart.isSome: contentLen = request.multipart.get.calcLength() + stdout.flushFile() + stderr.flushFile() let pid = fork() if pid == -1: handle.sendResult(ERROR_FAIL_SETUP_CGI) -- cgit 1.4.1-2-gfad0