mirror of
https://github.com/KeyZox71/webserv.git
synced 2025-05-10 21:58:46 +02:00
「🔨」 fix: fixed port issue and main loop issue for reasons only gods or kanel knows
This commit is contained in:
@ -6,13 +6,17 @@
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/14 12:20:06 by adjoly #+# #+# */
|
||||
/* Updated: 2025/04/22 15:25:39 by adjoly ### ########.fr */
|
||||
/* Updated: 2025/05/01 12:48:12 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cppeleven.hpp"
|
||||
#include <config/Server.hpp>
|
||||
#include <netinet/in.h>
|
||||
#include <stdexcept>
|
||||
#include <sys/socket.h>
|
||||
|
||||
namespace webserv {
|
||||
namespace config {
|
||||
@ -25,7 +29,14 @@ class Config {
|
||||
Logger *getLogger(void) { return _log; }
|
||||
|
||||
std::vector<Server *> getServers(void) { return _servers; }
|
||||
Server *getServer(const std::string &);
|
||||
Server *getServer(size_t i) {
|
||||
try {
|
||||
Server *srv = _servers.at(i);
|
||||
return srv;
|
||||
} catch (std::out_of_range &e) {
|
||||
return not_nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<Server *> _servers;
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/03/19 14:11:28 by adjoly #+# #+# */
|
||||
/* Updated: 2025/04/22 15:25:58 by adjoly ### ########.fr */
|
||||
/* Updated: 2025/04/30 17:10:53 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -61,6 +61,7 @@ class Server {
|
||||
// @brief Can be used to check if a servername is present in this config
|
||||
bool isServerName(const std::string &);
|
||||
|
||||
// @brief Can be used to get the route correcponding
|
||||
Route *whatRoute(const URL &);
|
||||
|
||||
protected:
|
||||
|
Reference in New Issue
Block a user