diff --git a/includes/server/Client.hpp b/includes/server/Client.hpp new file mode 100644 index 0000000..a13a55a --- /dev/null +++ b/includes/server/Client.hpp @@ -0,0 +1,33 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* Client.hpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: adjoly +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2025/04/14 14:14:39 by adjoly #+# #+# */ +/* Updated: 2025/04/14 15:00:41 by adjoly ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#pragma once + +#include "config/default.hpp" +#include "default.hpp" +#include "requests/default.hpp" +#include +#include + +class Client { + public: + Client(int, sockaddr_in); + ~Client(void); + + void answer(void); + private: + int _fd; + struct sockaddr_in _client_addr; + http::IRequest *_request; + http::Response *_response; + config::Config *_conf; +}; diff --git a/includes/server/server.hpp b/includes/server/server.hpp index 16e5915..f0f75fe 100644 --- a/includes/server/server.hpp +++ b/includes/server/server.hpp @@ -6,7 +6,7 @@ /* By: adjoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/04/11 17:45:43 by adjoly #+# #+# */ -/* Updated: 2025/04/14 13:42:20 by adjoly ### ########.fr */ +/* Updated: 2025/04/14 14:21:41 by adjoly ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,6 +15,7 @@ #include "log.hpp" #include #include +#include #include #include #include @@ -42,7 +43,7 @@ class Server { * * @param The number of the client fd */ - void _handle_client(int fd); + void _handle_client(Client); config::Config *_conf; ///> Pointer to the configuration class (with all config in) diff --git a/includes/webserv.hpp b/includes/webserv.hpp index 43b7042..7fb6d3a 100644 --- a/includes/webserv.hpp +++ b/includes/webserv.hpp @@ -6,11 +6,12 @@ /* By: mmoussou #ifndef __WEBSERV_WEBSERV_HPP__ # define __WEBSERV_WEBSERV_HPP__ diff --git a/src/server.cpp b/src/server.cpp index 641e293..59d81df 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -6,7 +6,7 @@ /* By: adjoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/04/11 16:11:40 by adjoly #+# #+# */ -/* Updated: 2025/04/14 13:41:59 by adjoly ### ########.fr */ +/* Updated: 2025/04/14 14:07:36 by adjoly ### ########.fr */ /* */ /* ************************************************************************** */