mirror of
https://github.com/KeyZox71/webserv.git
synced 2025-05-10 21:08:45 +02:00
「🔨」 fix: fixed compilation error
This commit is contained in:
4
Makefile
4
Makefile
@ -6,7 +6,7 @@
|
|||||||
# By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ #
|
# By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ #
|
||||||
# +#+#+#+#+#+ +#+ #
|
# +#+#+#+#+#+ +#+ #
|
||||||
# Created: 2024/10/25 16:09:27 by adjoly #+# #+# #
|
# Created: 2024/10/25 16:09:27 by adjoly #+# #+# #
|
||||||
# Updated: 2025/04/15 17:53:00 by adjoly ### ########.fr #
|
# Updated: 2025/04/22 14:31:00 by adjoly ### ########.fr #
|
||||||
# #
|
# #
|
||||||
# **************************************************************************** #
|
# **************************************************************************** #
|
||||||
|
|
||||||
@ -14,7 +14,7 @@ SHELL = bash
|
|||||||
|
|
||||||
NAME = webserv
|
NAME = webserv
|
||||||
|
|
||||||
CC = c++
|
CC = clang++
|
||||||
|
|
||||||
OBJSDIR = obj/
|
OBJSDIR = obj/
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/03/19 14:11:28 by adjoly #+# #+# */
|
/* Created: 2025/03/19 14:11:28 by adjoly #+# #+# */
|
||||||
/* Updated: 2025/04/22 12:44:16 by adjoly ### ########.fr */
|
/* Updated: 2025/04/22 14:25:17 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -59,23 +59,9 @@ class Server {
|
|||||||
int getPort(void) { return _port; }
|
int getPort(void) { return _port; }
|
||||||
|
|
||||||
// @brief Can be used to check if a servername is present in this config
|
// @brief Can be used to check if a servername is present in this config
|
||||||
bool isServerName(const std::string &server_name) {
|
bool isServerName(const std::string &);
|
||||||
for (auto it = prange(_server_names)) {
|
|
||||||
if (*it == server_name) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Route *whatRoute(const URL &url) {
|
Route *whatRoute(const URL &);
|
||||||
for (auto it = prange(_routes)) {
|
|
||||||
if (it->first == url) {
|
|
||||||
return it->second;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return not_nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
private:
|
private:
|
||||||
|
@ -6,16 +6,16 @@
|
|||||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/04/14 14:14:39 by adjoly #+# #+# */
|
/* Created: 2025/04/14 14:14:39 by adjoly #+# #+# */
|
||||||
/* Updated: 2025/04/22 12:04:57 by mmoussou ### ########.fr */
|
/* Updated: 2025/04/22 14:23:44 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <config/default.hpp>
|
#include <config/default.hpp>
|
||||||
#include <server/default.hpp>
|
|
||||||
#include <requests/default.hpp>
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
#include <requests/default.hpp>
|
||||||
|
#include <server/default.hpp>
|
||||||
#include <webserv.hpp>
|
#include <webserv.hpp>
|
||||||
|
|
||||||
namespace webserv {
|
namespace webserv {
|
||||||
@ -26,10 +26,10 @@ class Client {
|
|||||||
Client(int, sockaddr_in, config::Config *);
|
Client(int, sockaddr_in, config::Config *);
|
||||||
virtual ~Client(void);
|
virtual ~Client(void);
|
||||||
|
|
||||||
void answer(void);
|
void answer(void);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _getRequest(std::string);
|
void _getRequest(std::string);
|
||||||
|
|
||||||
int _fd;
|
int _fd;
|
||||||
struct sockaddr_in _client_addr;
|
struct sockaddr_in _client_addr;
|
||||||
@ -38,5 +38,5 @@ class Client {
|
|||||||
config::Server *_conf;
|
config::Server *_conf;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // -namespace server
|
} // namespace server
|
||||||
} // -namespace webserv
|
} // namespace webserv
|
||||||
|
@ -6,12 +6,14 @@
|
|||||||
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/02/11 13:29:21 by mmoussou #+# #+# */
|
/* Created: 2025/02/11 13:29:21 by mmoussou #+# #+# */
|
||||||
/* Updated: 2025/04/22 12:43:26 by adjoly ### ########.fr */
|
/* Updated: 2025/04/22 14:27:31 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#define auto __auto_type
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
@ -25,7 +27,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
#define auto __auto_type
|
|
||||||
#define range(x) \
|
#define range(x) \
|
||||||
x.begin(); \
|
x.begin(); \
|
||||||
it != x.end(); \
|
it != x.end(); \
|
||||||
|
@ -6,14 +6,14 @@
|
|||||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/04/14 12:53:54 by adjoly #+# #+# */
|
/* Created: 2025/04/14 12:53:54 by adjoly #+# #+# */
|
||||||
/* Updated: 2025/04/22 11:11:26 by adjoly ### ########.fr */
|
/* Updated: 2025/04/22 14:31:34 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include "webserv.hpp"
|
||||||
#include "cppeleven.hpp"
|
#include "cppeleven.hpp"
|
||||||
#include "node/ANode.hpp"
|
#include "node/ANode.hpp"
|
||||||
#include <config/default.hpp>
|
#include <config/default.hpp>
|
||||||
#include <webserv.hpp>
|
|
||||||
|
|
||||||
using namespace webserv::config;
|
using namespace webserv::config;
|
||||||
|
|
||||||
|
@ -6,10 +6,11 @@
|
|||||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/03/24 15:10:07 by adjoly #+# #+# */
|
/* Created: 2025/03/24 15:10:07 by adjoly #+# #+# */
|
||||||
/* Updated: 2025/04/22 12:38:59 by adjoly ### ########.fr */
|
/* Updated: 2025/04/22 14:26:00 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include <webserv.hpp>
|
||||||
#include <config/default.hpp>
|
#include <config/default.hpp>
|
||||||
|
|
||||||
using namespace webserv::config;
|
using namespace webserv::config;
|
||||||
@ -106,3 +107,21 @@ Server::_parseErrPages(std::map<std::string, toml::ANode *> *table) {
|
|||||||
}
|
}
|
||||||
return errPages;
|
return errPages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Server::isServerName(const std::string &server_name) {
|
||||||
|
for (auto it = prange(_server_names)) {
|
||||||
|
if (*it == server_name) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Route *Server::whatRoute(const URL &url) {
|
||||||
|
for (auto it = prange(_routes)) {
|
||||||
|
if (it->first == url) {
|
||||||
|
return it->second;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return not_nullptr;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user