all only host to be specified for unix sockets

This commit is contained in:
Ssamm45 2022-01-11 18:03:29 -07:00
parent ea0eb49d64
commit fa53cb3395
1 changed files with 2 additions and 2 deletions

4
cgi.d
View File

@ -4010,16 +4010,16 @@ void serveFastCgi(alias fun, CustomCgi = Cgi, long maxContentLength = defaultMax
}
auto lp = params.listeningPort;
auto host = params.listeningHost;
FCGX_Request request;
if(lp) {
if(lp || !host.empty) {
// if a listening port was specified on the command line, we want to spawn ourself
// (needed for nginx without spawn-fcgi, e.g. on Windows)
FCGX_Init();
int sock;
auto host = params.listeningHost;
if(host.startsWith("unix:")) {
sock = FCGX_OpenSocket(toStringz(params.listeningHost["unix:".length .. $]), 12);
} else if(host.startsWith("abstract:")) {