body write to CGI now monitored by epoll
+ kermit.jpg :)
This commit is contained in:
@@ -40,6 +40,15 @@ struct Request
|
||||
struct Script script;
|
||||
};
|
||||
|
||||
enum cgi_states
|
||||
{
|
||||
CGI_NO_CGI = 0,
|
||||
CGI_WAIT_TO_EXEC,
|
||||
CGI_READY_TO_EXEC,
|
||||
CGI_WAIT_FOR_OUTPUT,
|
||||
CGI_OUTPUT_READY
|
||||
};
|
||||
|
||||
class Client
|
||||
{
|
||||
public:
|
||||
@@ -58,7 +67,13 @@ class Client
|
||||
// size_t read_body_size; // unused for now
|
||||
ServerConfig *assigned_server; // cant be const cause of error_pages.operator[]
|
||||
const LocationConfig *assigned_location;
|
||||
int cgi_pipe_rfd;
|
||||
|
||||
// CGI variables
|
||||
int cgi_state;
|
||||
int cgi_pipe_w_to_child;
|
||||
int cgi_pipe_r_from_child;
|
||||
int cgi_pipe_w_to_parent;
|
||||
int cgi_pipe_r_from_parent;
|
||||
pid_t cgi_pid;
|
||||
std::string cgi_output;
|
||||
|
||||
@@ -88,7 +103,8 @@ class Client
|
||||
void parse_request_headers(std::vector<ServerConfig> &servers);
|
||||
void parse_request_body();
|
||||
void clear();
|
||||
void clear_request();
|
||||
void clear_request_vars();
|
||||
void clear_cgi_vars();
|
||||
void clear_script();
|
||||
void fill_script_path(std::string &path, size_t pos);
|
||||
// DEBUG
|
||||
|
||||
Reference in New Issue
Block a user