summaryrefslogtreecommitdiffabout
path: root/src/fastcgi.cc
Unidiff
Diffstat (limited to 'src/fastcgi.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--src/fastcgi.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/fastcgi.cc b/src/fastcgi.cc
index 63b59f8..641ae46 100644
--- a/src/fastcgi.cc
+++ b/src/fastcgi.cc
@@ -1,27 +1,28 @@
1#include <unistd.h> 1#include <unistd.h>
2#include <sys/types.h> 2#include <sys/types.h>
3#include <sys/stat.h> 3#include <sys/stat.h>
4#include <cstring>
4#include <fastcgi.h> 5#include <fastcgi.h>
5#include "kingate/fastcgi.h" 6#include "kingate/fastcgi.h"
6#include "kingate/exception.h" 7#include "kingate/exception.h"
7 8
8namespace kingate { 9namespace kingate {
9 10
10 bool fcgi_socket::_initialized = false; 11 bool fcgi_socket::_initialized = false;
11 12
12 fcgi_socket::fcgi_socket(const char *s,int bl) 13 fcgi_socket::fcgi_socket(const char *s,int bl)
13 : sock(-1) { 14 : sock(-1) {
14 if(!_initialized) { 15 if(!_initialized) {
15 if( FCGX_Init() ) 16 if( FCGX_Init() )
16 throw exception(CODEPOINT,"failed to FCGX_Init()"); 17 throw exception(CODEPOINT,"failed to FCGX_Init()");
17 _initialized = true; 18 _initialized = true;
18 } 19 }
19 if(!s) { 20 if(!s) {
20 sock = FCGI_LISTENSOCK_FILENO; 21 sock = FCGI_LISTENSOCK_FILENO;
21 }else{ 22 }else{
22 sock = FCGX_OpenSocket(s,bl); 23 sock = FCGX_OpenSocket(s,bl);
23 if(sock<0) 24 if(sock<0)
24 throw exception(CODEPOINT,"failed to FCGX_OpenSocket("); 25 throw exception(CODEPOINT,"failed to FCGX_OpenSocket(");
25 // TODO: check if there is a ':', not if it starts with ':' 26 // TODO: check if there is a ':', not if it starts with ':'
26 if(*s != ':') 27 if(*s != ':')
27 if(chmod(s,0777)) // XXX: configurable. 28 if(chmod(s,0777)) // XXX: configurable.