mirror of https://github.com/adamdruppe/arsd.git
issue #315 unix socket fastcgi
This commit is contained in:
parent
db81fdca67
commit
6d0d562315
13
cgi.d
13
cgi.d
|
@ -4016,7 +4016,18 @@ void serveFastCgi(alias fun, CustomCgi = Cgi, long maxContentLength = defaultMax
|
|||
// 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();
|
||||
auto sock = FCGX_OpenSocket(toStringz(params.listeningHost ~ ":" ~ to!string(lp)), 12);
|
||||
|
||||
int sock;
|
||||
|
||||
auto host = params.listeningHost;
|
||||
if(host.startsWith("unix:")) {
|
||||
sock = FCGX_OpenSocket(toStringz(params.listeningHosa["unix:".length .. $]), 12);
|
||||
} else if(host.startsWith("abstract:")) {
|
||||
sock = FCGX_OpenSocket(toStringz("\0" ~ params.listeningHosa["abstract:".length .. $]), 12);
|
||||
} else {
|
||||
sock = FCGX_OpenSocket(toStringz(params.listeningHost ~ ":" ~ to!string(lp)), 12);
|
||||
}
|
||||
|
||||
if(sock < 0)
|
||||
throw new Exception("Couldn't listen on the port");
|
||||
FCGX_InitRequest(&request, sock, 0);
|
||||
|
|
Loading…
Reference in New Issue