blob: 1cb7dc62c22360a537412b3c45a14a441f48a1fa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "kingate/plaincgi.h"
#include "kingate/exception.h"
#include "config.h"
#if !HAVE_DECL_ENVIRON
extern char **environ;
#endif /* HAVE_DECL_ENVIRON */
namespace kingate {
plaincgi_interface::plaincgi_interface() {
for(char **p = environ; *p; p++) {
const char *e = strchr(*p,'=');
if(!e){
// XXX: check if we have it already?
metavars[*p] = string(0);
}else{
int l = e-*p; e++;
// XXX: check if we have it already?
metavars[string(*p,l)]=e;
}
}
}
plaincgi_interface::~plaincgi_interface() {
cout.flush();
cerr.flush();
}
}
|