summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/fastcgi.cc19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/fastcgi.cc b/src/fastcgi.cc
index 8b7668c..63b59f8 100644
--- a/src/fastcgi.cc
+++ b/src/fastcgi.cc
@@ -3,2 +3,3 @@
#include <sys/stat.h>
+#include <fastcgi.h>
#include "kingate/fastcgi.h"
@@ -17,9 +18,13 @@ namespace kingate {
}
- sock = FCGX_OpenSocket(s,bl);
- if(sock<0)
- throw exception(CODEPOINT,"failed to FCGX_OpenSocket(");
- // TODO: check if there is a ':', not if it starts with ':'
- if(*s != ':')
- if(chmod(s,0777)) // XXX: configurable.
- throw exception(CODEPOINT,"failed to chmod()");
+ if(!s) {
+ sock = FCGI_LISTENSOCK_FILENO;
+ }else{
+ sock = FCGX_OpenSocket(s,bl);
+ if(sock<0)
+ throw exception(CODEPOINT,"failed to FCGX_OpenSocket(");
+ // TODO: check if there is a ':', not if it starts with ':'
+ if(*s != ':')
+ if(chmod(s,0777)) // XXX: configurable.
+ throw exception(CODEPOINT,"failed to chmod()");
+ }
}