summaryrefslogtreecommitdiffabout
path: root/src
Unidiff
Diffstat (limited to 'src') (more/less context) (ignore whitespace changes)
-rw-r--r--src/Makefile.am12
-rw-r--r--src/fastcgi.cc1
-rw-r--r--src/plaincgi.cc27
3 files changed, 38 insertions, 2 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 8a5447b..e5c6778 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,8 @@
1lib_LTLIBRARIES = libkingate.la libkingate-fcgi.la 1lib_LTLIBRARIES = libkingate.la libkingate-plaincgi.la
2
3if HAVE_FCGI
4lib_LTLIBRARIES += libkingate-fcgi.la
5endif
2 6
3INCLUDES = -I${top_srcdir}/include 7INCLUDES = -I${top_srcdir}/include
4AM_CXXFLAGS = ${KONFORKA_CFLAGS} 8AM_CXXFLAGS = ${KONFORKA_CFLAGS}
@@ -13,3 +17,9 @@ libkingate_la_LDFLAGS = -version-info 1:0:0
13libkingate_fcgi_la_SOURCES = \ 17libkingate_fcgi_la_SOURCES = \
14 fastcgi.cc 18 fastcgi.cc
15libkingate_fcgi_la_LDFLAGS = -version-info 1:0:0 19libkingate_fcgi_la_LDFLAGS = -version-info 1:0:0
20
21libkingate_plaincgi_la_SOURCES = \
22 plaincgi.cc
23libkingate_plaincgi_la_LDFLAGS = -version-info 1:0:0
24
25EXTRA_DIST = ${libkingate_fcgi_la_SOURCES}
diff --git a/src/fastcgi.cc b/src/fastcgi.cc
index 7484449..6285370 100644
--- a/src/fastcgi.cc
+++ b/src/fastcgi.cc
@@ -45,7 +45,6 @@ namespace kingate {
45 sbin.attach(request.in); 45 sbin.attach(request.in);
46 sbout.attach(request.out); 46 sbout.attach(request.out);
47 sberr.attach(request.err); 47 sberr.attach(request.err);
48 metavars.clear(); // XXX: redundant.
49 for(char **p = request.envp; *p; p++) { 48 for(char **p = request.envp; *p; p++) {
50 const char *e = strchr(*p,'='); 49 const char *e = strchr(*p,'=');
51 if(!e){ 50 if(!e){
diff --git a/src/plaincgi.cc b/src/plaincgi.cc
new file mode 100644
index 0000000..6934748
--- a/dev/null
+++ b/src/plaincgi.cc
@@ -0,0 +1,27 @@
1#include <unistd.h>
2#include <sys/types.h>
3#include <sys/stat.h>
4#include "kingate/plaincgi.h"
5#include "kingate/exception.h"
6
7namespace kingate {
8
9 plaincgi_interface::plaincgi_interface() {
10 for(char **p = environ; *p; p++) {
11 const char *e = strchr(*p,'=');
12 if(!e){
13 // XXX: check if we have it already?
14 metavars[*p] = string(0);
15 }else{
16 int l = e-*p; e++;
17 // XXX: check if we have it already?
18 metavars[string(*p,l)]=e;
19 }
20 }
21 }
22 plaincgi_interface::~plaincgi_interface() {
23 cout.flush();
24 cerr.flush();
25 }
26
27}