summaryrefslogtreecommitdiffabout
authorMichael Krelin @devel <hacker@klever.net>2009-03-11 20:05:54 (UTC)
committer Michael Krelin @devel <hacker@klever.net>2009-03-11 20:05:54 (UTC)
commitf1eed2b661d43b7e39e1aea16d9453a538206564 (patch) (unidiff)
tree7f340d0294baecd1e8719026f16b71000ca4712d
parentf4db51309c0333434d9ee96bc52593dacab04c69 (diff)
downloadkingate-f1eed2b661d43b7e39e1aea16d9453a538206564.zip
kingate-f1eed2b661d43b7e39e1aea16d9453a538206564.tar.gz
kingate-f1eed2b661d43b7e39e1aea16d9453a538206564.tar.bz2
missing headers for gcc 4.3
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--src/fastcgi.cc1
-rw-r--r--src/plaincgi.cc1
-rw-r--r--src/util.cc2
3 files changed, 4 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.
diff --git a/src/plaincgi.cc b/src/plaincgi.cc
index 1cb7dc6..3a82d33 100644
--- a/src/plaincgi.cc
+++ b/src/plaincgi.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 "kingate/plaincgi.h" 5#include "kingate/plaincgi.h"
5#include "kingate/exception.h" 6#include "kingate/exception.h"
6#include "config.h" 7#include "config.h"
7 8
8#if !HAVE_DECL_ENVIRON 9#if !HAVE_DECL_ENVIRON
9extern char **environ; 10extern char **environ;
10#endif /* HAVE_DECL_ENVIRON */ 11#endif /* HAVE_DECL_ENVIRON */
11 12
12namespace kingate { 13namespace kingate {
13 14
14 plaincgi_interface::plaincgi_interface() { 15 plaincgi_interface::plaincgi_interface() {
15 for(char **p = environ; *p; p++) { 16 for(char **p = environ; *p; p++) {
16 const char *e = strchr(*p,'='); 17 const char *e = strchr(*p,'=');
17 if(!e){ 18 if(!e){
18 // XXX: check if we have it already? 19 // XXX: check if we have it already?
19 metavars[*p] = string(0); 20 metavars[*p] = string(0);
20 }else{ 21 }else{
21 int l = e-*p; e++; 22 int l = e-*p; e++;
22 // XXX: check if we have it already? 23 // XXX: check if we have it already?
23 metavars[string(*p,l)]=e; 24 metavars[string(*p,l)]=e;
24 } 25 }
25 } 26 }
26 } 27 }
27 plaincgi_interface::~plaincgi_interface() { 28 plaincgi_interface::~plaincgi_interface() {
diff --git a/src/util.cc b/src/util.cc
index 48e486a..82a4a0a 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -1,24 +1,26 @@
1#include <cstdlib>
2#include <cstring>
1#include "kingate/util.h" 3#include "kingate/util.h"
2#include "kingate/exception.h" 4#include "kingate/exception.h"
3 5
4namespace kingate { 6namespace kingate {
5 7
6 static const char *safeChars = 8 static const char *safeChars =
7 "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 9 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
8 "abcdefghijklmnopqrstuvwxyz" 10 "abcdefghijklmnopqrstuvwxyz"
9 "0123456789" 11 "0123456789"
10 "_-" ; 12 "_-" ;
11 13
12 string url_encode(const string& str) { 14 string url_encode(const string& str) {
13 string rv = str; 15 string rv = str;
14 string::size_type screwed = 0; 16 string::size_type screwed = 0;
15 for(;;) { 17 for(;;) {
16 screwed = rv.find_first_not_of(safeChars,screwed); 18 screwed = rv.find_first_not_of(safeChars,screwed);
17 if(screwed == string::npos) 19 if(screwed == string::npos)
18 break; 20 break;
19 while(screwed<rv.length() && !strchr(safeChars,rv.at(screwed))) { 21 while(screwed<rv.length() && !strchr(safeChars,rv.at(screwed))) {
20 char danger = rv.at(screwed); 22 char danger = rv.at(screwed);
21 if(danger==' ') { 23 if(danger==' ') {
22 rv.replace(screwed++,1,1,'+'); 24 rv.replace(screwed++,1,1,'+');
23 }else{ 25 }else{
24 static char tmp[4] = {'%',0,0,0}; 26 static char tmp[4] = {'%',0,0,0};