Moved most request errors check in Client

+ bugfix of "Bad file descriptor" due to empty operator=() in Client
+ added a condition in _determine_location_COOP_FIX()
+ udpate memo.txt
+ need fix for index/autoindex (location "/list" dont work)
This commit is contained in:
LuckyLaszlo
2022-08-10 07:19:05 +02:00
parent 58f67bf42e
commit 86f7740984
13 changed files with 134 additions and 118 deletions

View File

@@ -39,8 +39,8 @@ class Client
Client();
Client(int afd, listen_socket *lsocket, std::string aport, std::string aip);
~Client();
Client(Client const &src);
Client &operator=(Client const &rhs);
// Client(Client const &src);
// Client &operator=(Client const &rhs);
std::string raw_request;
std::string response;
@@ -70,7 +70,8 @@ class Client
std::string get_rq_script_info() const;
std::string get_rq_headers(const std::string & key) const;
void parse_request();
void parse_request(std::vector<ServerConfig> &servers);
void parse_request_body();
void clear();
void clear_request();
void clear_script();
@@ -85,15 +86,19 @@ class Client
void _parse_request_line();
void _parse_request_headers();
void _parse_request_body();
void _parse_request_uri( std::string uri );
void _parse_port_hostname(std::string host);
void _check_request_errors();
};
bool operator==(const Client& lhs, const Client& rhs);
bool operator==(const Client& lhs, int fd);
bool operator==(int fd, const Client& rhs);
// Temporary Global Scope. Probably move to Client in the future.
ServerConfig *_determine_process_server(Client *client, std::vector<ServerConfig> &servers);
const LocationConfig *_determine_location(const ServerConfig &server, const std::string &path);
#endif