script path is found and fill

This commit is contained in:
hugogogo
2022-08-07 15:51:36 +02:00
parent e0fd743b5b
commit 7ecfc22c7b
5 changed files with 106 additions and 46 deletions

View File

@@ -11,6 +11,12 @@
# include <netinet/in.h> // sockaddr_in, struct in_addr
# include <arpa/inet.h> // htonl, htons, ntohl, ntohs, inet_addr, inet_ntoa
struct Script
{
std::string path;
std::string info;
};
struct Request
{
http_method method;
@@ -22,6 +28,7 @@ struct Request
std::string body;
std::string port;
std::string hostname;
struct Script script;
};
# define MAX_FILESIZE 1000000 // (1Mo)
@@ -56,11 +63,15 @@ class Client
std::string get_rq_body() const;
std::string get_rq_port() const;
std::string get_rq_hostname() const;
std::string get_rq_script_path() const;
std::string get_rq_script_info() const;
std::string get_rq_headers(const std::string & key) const;
void parse_request();
void clear();
void clear_request();
void clear_script();
bool fill_script_path(std::string script);
private:
int _fd;