mirror of https://github.com/adamdruppe/arsd.git
commit
956105e969
8
cgi.d
8
cgi.d
|
@ -4010,20 +4010,20 @@ void serveFastCgi(alias fun, CustomCgi = Cgi, long maxContentLength = defaultMax
|
||||||
}
|
}
|
||||||
|
|
||||||
auto lp = params.listeningPort;
|
auto lp = params.listeningPort;
|
||||||
|
auto host = params.listeningHost;
|
||||||
|
|
||||||
FCGX_Request request;
|
FCGX_Request request;
|
||||||
if(lp) {
|
if(lp || !host.empty) {
|
||||||
// if a listening port was specified on the command line, we want to spawn ourself
|
// 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)
|
// (needed for nginx without spawn-fcgi, e.g. on Windows)
|
||||||
FCGX_Init();
|
FCGX_Init();
|
||||||
|
|
||||||
int sock;
|
int sock;
|
||||||
|
|
||||||
auto host = params.listeningHost;
|
|
||||||
if(host.startsWith("unix:")) {
|
if(host.startsWith("unix:")) {
|
||||||
sock = FCGX_OpenSocket(toStringz(params.listeningHosa["unix:".length .. $]), 12);
|
sock = FCGX_OpenSocket(toStringz(params.listeningHost["unix:".length .. $]), 12);
|
||||||
} else if(host.startsWith("abstract:")) {
|
} else if(host.startsWith("abstract:")) {
|
||||||
sock = FCGX_OpenSocket(toStringz("\0" ~ params.listeningHosa["abstract:".length .. $]), 12);
|
sock = FCGX_OpenSocket(toStringz("\0" ~ params.listeningHost["abstract:".length .. $]), 12);
|
||||||
} else {
|
} else {
|
||||||
sock = FCGX_OpenSocket(toStringz(params.listeningHost ~ ":" ~ to!string(lp)), 12);
|
sock = FCGX_OpenSocket(toStringz(params.listeningHost ~ ":" ~ to!string(lp)), 12);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue