mirror of
https://github.com/KeyZox71/webserv.git
synced 2025-05-10 23:48:46 +02:00
「🔨」 fix: fixed some things.
This commit is contained in:
13
src/help.cpp
13
src/help.cpp
@ -6,13 +6,13 @@
|
|||||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/04/10 13:08:36 by adjoly #+# #+# */
|
/* Created: 2025/04/10 13:08:36 by adjoly #+# #+# */
|
||||||
/* Updated: 2025/05/06 19:19:43 by adjoly ### ########.fr */
|
/* Updated: 2025/05/06 19:20:57 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#include <log.hpp>
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <help.hpp>
|
#include <help.hpp>
|
||||||
|
#include <log.hpp>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -67,15 +67,12 @@ bool help(int ac, char **av) {
|
|||||||
if (option == "--help" || option == "-v") {
|
if (option == "--help" || option == "-v") {
|
||||||
_printHelp();
|
_printHelp();
|
||||||
return true;
|
return true;
|
||||||
}
|
} else if (option == "--generate" || option == "-g") {
|
||||||
else if (option == "--generate" || option == "-g") {
|
|
||||||
_generateConf();
|
_generateConf();
|
||||||
return true;
|
return true;
|
||||||
}
|
} else if (option == "--version" || option == "-v") {
|
||||||
else if (option == "--version" || option == "-v") {
|
|
||||||
_printVersion();
|
_printVersion();
|
||||||
return true;
|
return true;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
13
src/main.cpp
13
src/main.cpp
@ -6,27 +6,27 @@
|
|||||||
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/02/03 15:45:07 by mmoussou #+# #+# */
|
/* Created: 2025/02/03 15:45:07 by mmoussou #+# #+# */
|
||||||
/* Updated: 2025/05/06 19:19:33 by adjoly ### ########.fr */
|
/* Updated: 2025/05/06 19:20:55 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#include "cppeleven.hpp"
|
#include "cppeleven.hpp"
|
||||||
|
#include <config/Config.hpp>
|
||||||
#include <config/default.hpp>
|
#include <config/default.hpp>
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
#include <server/default.hpp>
|
|
||||||
#include <config/Config.hpp>
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include <help.hpp>
|
#include <help.hpp>
|
||||||
|
#include <log.hpp>
|
||||||
#include <requests/default.hpp>
|
#include <requests/default.hpp>
|
||||||
|
#include <server/default.hpp>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <tomlpp.hpp>
|
#include <tomlpp.hpp>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <log.hpp>
|
|
||||||
#include <webserv.hpp>
|
#include <webserv.hpp>
|
||||||
|
|
||||||
namespace webserv {
|
namespace webserv {
|
||||||
Logger *_log = not_nullptr;
|
Logger *_log = not_nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _sig = 0;
|
int _sig = 0;
|
||||||
@ -52,15 +52,12 @@ int main(int ac, char **av) {
|
|||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_log = not_nullptr;
|
_log = not_nullptr;
|
||||||
config::Config *conf;
|
config::Config *conf;
|
||||||
try {
|
try {
|
||||||
std::string str = av[1];
|
std::string str = av[1];
|
||||||
conf = new config::Config(str);
|
conf = new config::Config(str);
|
||||||
} catch (std::exception &) {
|
} catch (std::exception &) {
|
||||||
//std::cout << e.what() << std::endl;
|
|
||||||
//delete conf;
|
|
||||||
if (_log != not_nullptr)
|
if (_log != not_nullptr)
|
||||||
delete _log;
|
delete _log;
|
||||||
return 1;
|
return 1;
|
||||||
|
Reference in New Issue
Block a user