-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathFcgi.hpp
63 lines (46 loc) · 1.07 KB
/
Fcgi.hpp
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef ___INANITY_NET_FCGI_HPP___
#define ___INANITY_NET_FCGI_HPP___
#include "net.hpp"
#include "../Handler.hpp"
#include "../deps/fcgi/fcgiapp.h"
BEGIN_INANITY
class InputStream;
class OutputStream;
END_INANITY
BEGIN_INANITY_NET
/// Simple class for single-threaded FCGI handler.
class Fcgi
{
private:
class InStream;
class OutStream;
int fd;
public:
class Request : public Object
{
private:
FCGX_Request request;
ptr<InStream> inputStream;
ptr<OutStream> outputStream;
public:
Request(int fd);
~Request();
ptr<InputStream> GetInputStream() const;
ptr<OutputStream> GetOutputStream() const;
char** GetEnv() const;
const char* GetParam(const char* name) const;
void OutputHeader(const char* header, const char* value);
void OutputStatus(const char* status);
void OutputContentType(const char* contentType);
void OutputBeginResponse();
/// End response and finalize request.
void End();
//*** Don't call explicitly.
bool Accept();
};
public:
Fcgi(const char* socketName, int backlogSize);
ptr<Request> Accept();
};
END_INANITY_NET
#endif