You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
632 B
26 lines
632 B
#pragma once
|
|
#include "webserv.hpp"
|
|
|
|
typedef std::map< string, std::vector< string > > request_t;
|
|
|
|
class Client {
|
|
int _fd;
|
|
listen_t _listen;
|
|
Master *_parent;
|
|
string _header;
|
|
string _content;
|
|
request_t _request;
|
|
|
|
public:
|
|
Client(int fd, listen_t listen, Master *parent);
|
|
~Client(void);
|
|
bool getRequest(string paquet);
|
|
bool parseHeader();
|
|
string header_pick(string key, int id);
|
|
void answer(Env *env);
|
|
bool check_method(Server *server, Route *route, string method);
|
|
void send_cgi(string cgi, string path);
|
|
void send_error(int error_code);
|
|
void send_answer(string msg);
|
|
friend class Master;
|
|
};
|
|
|