diff options
author | bptato <nincsnevem662@gmail.com> | 2024-03-07 00:39:04 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-03-07 00:39:28 +0100 |
commit | 337828e5d46f1fe10fea2281422b19c54eb0b9bd (patch) | |
tree | ca318e56327a8ca4e925cfe4b693b389eadec97d /src/loader | |
parent | 01b42054795768837b6114dafdf27fc4faf8c53a (diff) | |
download | chawan-337828e5d46f1fe10fea2281422b19c54eb0b9bd.tar.gz |
cgi: pass system error message after execl failure
Diffstat (limited to 'src/loader')
-rw-r--r-- | src/loader/cgi.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/loader/cgi.nim b/src/loader/cgi.nim index cb6e8ae4..848df1b7 100644 --- a/src/loader/cgi.nim +++ b/src/loader/cgi.nim @@ -211,7 +211,8 @@ proc loadCGI*(handle: LoaderHandle, request: Request, cgiDir: seq[string], contentLen, prevURL) discard execl(cstring(cmd), cstring(basename), nil) let code = int(ERROR_FAILED_TO_EXECUTE_CGI_SCRIPT) - stdout.write("Cha-Control: ConnectionError " & $code) + stdout.write("Cha-Control: ConnectionError " & $code & + ($strerror(errno)).deleteChars({'\n', '\r'})) quit(1) else: discard close(pipefd[1]) # close write |