diff --git a/includes/Client.hpp b/includes/Client.hpp index f4d62e7..eff5ba4 100644 --- a/includes/Client.hpp +++ b/includes/Client.hpp @@ -8,27 +8,30 @@ class Client { ip_port_t _ip_port; Master *_parent; - string _method; - string _uri; - string _host; - string _len; + string _method; + string _uri; + string _host; + int _len; + int _last_len; + Server *_server; Route *_route; string _header; - string _content; + string _body; request_t _request; public: Client(int fd, ip_port_t ip_port, Master *parent); ~Client(void); void clean(void); - bool getRequest(Env *env, string paquet); bool parseHeader(Env *env); string header_pick(string key, size_t id); void answer(); bool check_method(); + void create_file(string path); void send_cgi(string cgi, string path); + void send_cgi_redir(string cgi, string path); void send_error(int error_code); void send_answer(string msg); diff --git a/srcs/load/Route.cpp b/srcs/load/Route.cpp index 8012c44..b6f0598 100644 --- a/srcs/load/Route.cpp +++ b/srcs/load/Route.cpp @@ -64,11 +64,11 @@ string Route::getIndex(string uri, string path) { struct dirent *entry; struct stat info; std::vector< string >::iterator it; - cout << "get index(): path=" << path << "\n"; - if ((dir = opendir(path.c_str())) == NULL) + if ((dir = opendir(path.c_str())) == NULL) { return ""; - else { + } else { + cout << "get index(): path=" << path << "\n"; content << "

" << path << " files :

\n