summaryrefslogtreecommitdiffabout
path: root/src/fastcgi.cc
authorMichael Krelin <hacker@klever.net>2020-10-07 22:52:19 (UTC)
committer Michael Krelin <hacker@klever.net>2020-10-07 22:52:19 (UTC)
commitc561689bf162fb22997bd88f4392f222f151c950 (patch) (side-by-side diff)
treece4656e92c379f7089f4bb72a4b10d781b61211e /src/fastcgi.cc
parent3a4530372bc95d728dbddbac788f2c1f2d03a030 (diff)
downloadkingate-master.zip
kingate-master.tar.gz
kingate-master.tar.bz2
missing includesHEADmaster
Diffstat (limited to 'src/fastcgi.cc') (more/less context) (show 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 8b7668c..5a6c081 100644
--- a/src/fastcgi.cc
+++ b/src/fastcgi.cc
@@ -1,35 +1,36 @@
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <cstring>
#include "kingate/fastcgi.h"
#include "kingate/exception.h"
namespace kingate {
bool fcgi_socket::_initialized = false;
fcgi_socket::fcgi_socket(const char *s,int bl)
: sock(-1) {
if(!_initialized) {
if( FCGX_Init() )
throw exception(CODEPOINT,"failed to FCGX_Init()");
_initialized = true;
}
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()");
}
fcgi_socket::fcgi_socket(int s)
: sock(0) {
if(!_initialized) {
if( FCGX_Init() )
throw exception(CODEPOINT,"failed to FCGX_Init()");
_initialized = true;
}
}
fcgi_socket::~fcgi_socket() {
if(sock>=0)