fix: apply IWYU suggestions
This commit is contained in:
parent
c841142e79
commit
143498315b
@ -1,15 +1,15 @@
|
|||||||
#include <webserv/client/Client.hpp>
|
#include <webserv/client/Client.hpp>
|
||||||
#include <webserv/http/HttpHeaders.hpp> // for HttpHeaders
|
#include <webserv/http/HttpHeaders.hpp> // for HttpHeaders
|
||||||
#include <webserv/log/Log.hpp> // for Log
|
#include <webserv/log/Log.hpp> // for Log, LOCATION
|
||||||
#include <webserv/server/Server.hpp> // for Server
|
#include <webserv/server/Server.hpp> // for Server
|
||||||
#include <webserv/socket/Socket.hpp> // for Socket
|
#include <webserv/socket/Socket.hpp> // for Socket
|
||||||
|
#include <sys/types.h> // for ssize_t
|
||||||
|
#include <cstdint> // for uint8_t
|
||||||
|
#include <functional> // for reference_wrapper, cref, ref
|
||||||
|
#include <map> // for map
|
||||||
|
#include <utility> // for pair, move
|
||||||
|
|
||||||
#include <cstdint> // for uint8_t
|
class ServerConfig;
|
||||||
#include <functional> // for reference_wrapper, cref, ref
|
|
||||||
#include <map> // for map
|
|
||||||
#include <utility> // for pair, move
|
|
||||||
|
|
||||||
#include <sys/types.h> // for ssize_t
|
|
||||||
|
|
||||||
Client::Client(std::unique_ptr<Socket> socket, Server &server, const ServerConfig &server_config)
|
Client::Client(std::unique_ptr<Socket> socket, Server &server, const ServerConfig &server_config)
|
||||||
: client_socket_(std::move(socket)), server_(std::ref(server)), server_config_(std::cref(server_config)),
|
: client_socket_(std::move(socket)), server_(std::ref(server)), server_config_(std::cref(server_config)),
|
||||||
|
|||||||
@ -1,16 +1,16 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <webserv/config/ServerConfig.hpp> // for ServerConfig
|
#include <webserv/config/ServerConfig.hpp> // for ServerConfig
|
||||||
#include <webserv/http/HttpRequest.hpp> // for HttpRequest
|
#include <webserv/http/HttpRequest.hpp> // for HttpRequest
|
||||||
#include <webserv/server/Server.hpp>
|
#include <webserv/server/Server.hpp>
|
||||||
#include <webserv/socket/Socket.hpp>
|
#include <webserv/socket/Socket.hpp>
|
||||||
|
#include <cstddef> // for size_t
|
||||||
#include <cstddef> // for size_t
|
#include <memory> // for unique_ptr
|
||||||
#include <memory> // for unique_ptr
|
#include <string> // for string
|
||||||
#include <string> // for string
|
|
||||||
|
|
||||||
class Server;
|
class Server;
|
||||||
class Socket;
|
class Socket;
|
||||||
|
class ServerConfig;
|
||||||
|
|
||||||
class Client
|
class Client
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
#include <webserv/config/AConfig.hpp> // for AConfig
|
#include <webserv/config/AConfig.hpp> // for AConfig
|
||||||
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
||||||
#include <webserv/config/directive/DirectiveFactory.hpp> // for DirectiveFactory
|
#include <webserv/config/directive/DirectiveFactory.hpp> // for DirectiveFactory
|
||||||
#include <webserv/config/utils.hpp> // for trim
|
#include <webserv/config/utils.hpp> // for trim
|
||||||
#include <webserv/log/Log.hpp> // for Log, LOCATION
|
#include <webserv/log/Log.hpp> // for Log, LOCATION
|
||||||
|
#include <sstream> // for basic_stringstream, stringstream
|
||||||
|
#include <utility> // for move, pair
|
||||||
|
|
||||||
AConfig::AConfig(const AConfig *parent) : parent_(parent) {}
|
AConfig::AConfig(const AConfig *parent) : parent_(parent) {}
|
||||||
|
|
||||||
|
|||||||
@ -1,13 +1,12 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
||||||
|
#include <map> // for map
|
||||||
|
#include <memory> // for unique_ptr
|
||||||
|
#include <string> // for basic_string, string
|
||||||
|
|
||||||
#include "webserv/config/directive/DirectiveValue.hpp"
|
#include "webserv/config/directive/DirectiveValue.hpp"
|
||||||
|
|
||||||
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
|
||||||
|
|
||||||
#include <map>
|
|
||||||
#include <memory>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
class AConfig
|
class AConfig
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -1,13 +1,12 @@
|
|||||||
#include <webserv/config/ConfigManager.hpp>
|
#include <webserv/config/ConfigManager.hpp>
|
||||||
#include <webserv/config/ServerConfig.hpp> // for ServerConfig
|
#include <webserv/config/utils.hpp> // for removeComments
|
||||||
#include <webserv/config/directive/DirectiveFactory.hpp> // for DirectiveFactory
|
#include <webserv/log/Log.hpp> // for Log
|
||||||
#include <webserv/config/utils.hpp> // for trim, findCorrespondingClosingBrace, trimSemi
|
#include <fstream> // for basic_ifstream, basic_filebuf, basic_ostream::operator<<, ifstream, stringstream
|
||||||
#include <webserv/log/Log.hpp> // for Log, LOCATION
|
#include <sstream> // for basic_stringstream
|
||||||
|
#include <stdexcept> // for runtime_error
|
||||||
|
#include <string> // for char_traits, operator+, basic_string, string
|
||||||
|
|
||||||
#include <fstream> // for basic_ifstream, basic_istream, basic_filebuf, basic_ostream::operator<<, stringstream, ifstream, istringstream
|
#include "webserv/config/GlobalConfig.hpp" // for GlobalConfig
|
||||||
#include <sstream> // for basic_stringstream, basic_istringstream
|
|
||||||
#include <stdexcept> // for runtime_error
|
|
||||||
#include <string> // for basic_string, char_traits, string, operator+, to_string, getline, operator<=>
|
|
||||||
|
|
||||||
ConfigManager::ConfigManager() : initialized_(false) {}
|
ConfigManager::ConfigManager() : initialized_(false) {}
|
||||||
|
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <webserv/config/GlobalConfig.hpp>
|
#include <webserv/config/GlobalConfig.hpp>
|
||||||
#include <webserv/config/ServerConfig.hpp> // for ServerConfig
|
#include <webserv/config/ServerConfig.hpp> // for ServerConfig
|
||||||
|
#include <memory> // for unique_ptr
|
||||||
#include <memory> // for unique_ptr
|
#include <string> // for string
|
||||||
#include <string> // for string
|
#include <vector> // for vector
|
||||||
#include <vector> // for vector
|
|
||||||
|
|
||||||
class ADirective;
|
class ADirective;
|
||||||
|
class GlobalConfig;
|
||||||
|
|
||||||
class ConfigManager
|
class ConfigManager
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
#include <webserv/config/GlobalConfig.hpp>
|
#include <webserv/config/GlobalConfig.hpp>
|
||||||
#include <webserv/config/utils.hpp>
|
#include <webserv/config/utils.hpp> // for findCorrespondingClosingBrace
|
||||||
#include <webserv/log/Log.hpp> // for Log, LOCATION
|
#include <webserv/log/Log.hpp> // for Log
|
||||||
|
#include <stddef.h> // for size_t
|
||||||
#include <vector>
|
#include <vector> // for vector
|
||||||
|
#include <stdexcept> // for runtime_error
|
||||||
|
|
||||||
GlobalConfig::GlobalConfig(const std::string &block)
|
GlobalConfig::GlobalConfig(const std::string &block)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,7 +1,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <webserv/config/AConfig.hpp> // for AConfig
|
#include <webserv/config/AConfig.hpp> // for AConfig
|
||||||
#include <webserv/config/ServerConfig.hpp>
|
#include <webserv/config/ServerConfig.hpp> // for ServerConfig
|
||||||
|
#include <memory> // for unique_ptr
|
||||||
|
#include <string> // for string
|
||||||
|
#include <vector> // for vector
|
||||||
|
|
||||||
class GlobalConfig : public AConfig
|
class GlobalConfig : public AConfig
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <webserv/config/AConfig.hpp> // for AConfig
|
#include <webserv/config/AConfig.hpp> // for AConfig
|
||||||
|
#include <string> // for string
|
||||||
|
|
||||||
class LocationConfig : public AConfig
|
class LocationConfig : public AConfig
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,7 +1,12 @@
|
|||||||
#include <webserv/config/LocationConfig.hpp>
|
#include <webserv/config/LocationConfig.hpp> // for LocationConfig
|
||||||
#include <webserv/config/ServerConfig.hpp>
|
#include <webserv/config/ServerConfig.hpp>
|
||||||
#include <webserv/config/utils.hpp>
|
#include <webserv/config/utils.hpp> // for findCorrespondingClosingBrace, trim
|
||||||
#include <webserv/log/Log.hpp> // for Log, LOCATION
|
#include <webserv/log/Log.hpp> // for Log, LOCATION
|
||||||
|
#include <stddef.h> // for size_t
|
||||||
|
#include <stdexcept> // for runtime_error
|
||||||
|
#include <utility> // for pair
|
||||||
|
|
||||||
|
#include "webserv/config/AConfig.hpp" // for AConfig
|
||||||
|
|
||||||
ServerConfig::ServerConfig(const std::string &block, const AConfig *parent) : AConfig(parent)
|
ServerConfig::ServerConfig(const std::string &block, const AConfig *parent) : AConfig(parent)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,7 +1,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <webserv/config/AConfig.hpp> // for AConfig
|
#include <webserv/config/AConfig.hpp> // for AConfig
|
||||||
#include <webserv/config/LocationConfig.hpp> // for LocationConfig
|
#include <webserv/config/LocationConfig.hpp> // for LocationConfig
|
||||||
|
#include <map> // for map
|
||||||
|
#include <memory> // for unique_ptr
|
||||||
|
#include <string> // for basic_string, string
|
||||||
|
#include <vector> // for vector
|
||||||
|
|
||||||
class ServerConfig : public AConfig
|
class ServerConfig : public AConfig
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <webserv/config/directive/DirectiveValue.hpp> // for DirectiveValue, DirectiveValueType
|
#include <webserv/config/directive/DirectiveValue.hpp> // for DirectiveValue, DirectiveValueType
|
||||||
|
|
||||||
#include <iostream> // for ostream
|
#include <iostream> // for ostream
|
||||||
#include <string> // for string, basic_string
|
#include <string> // for string, basic_string
|
||||||
#include <utility> // for move
|
#include <utility> // for move
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
#include <webserv/config/directive/BoolDirective.hpp> // for IntDirective
|
#include <webserv/config/directive/BoolDirective.hpp> // for IntDirective
|
||||||
#include <webserv/config/utils.hpp> // for trim
|
#include <webserv/config/utils.hpp> // for trim
|
||||||
|
#include <algorithm> // for __transform_fn, transform
|
||||||
|
#include <cctype> // for tolower
|
||||||
|
#include <stdexcept> // for invalid_argument
|
||||||
|
|
||||||
#include <algorithm> // for __transform_fn, transform
|
#include "webserv/config/directive/ADirective.hpp" // for ADirective
|
||||||
#include <cctype> // for tolower
|
#include "webserv/config/directive/DirectiveValue.hpp" // for DirectiveValueType
|
||||||
#include <stdexcept> // for invalid_argument
|
|
||||||
|
|
||||||
BoolDirective::BoolDirective(const std::string &name, const std::string &value)
|
BoolDirective::BoolDirective(const std::string &name, const std::string &value)
|
||||||
: ADirective(name) // NOLINT(bugprone-easily-swappable-parameters)
|
: ADirective(name) // NOLINT(bugprone-easily-swappable-parameters)
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
||||||
#include <webserv/config/directive/DirectiveValue.hpp> // for DirectiveValueType
|
#include <webserv/config/directive/DirectiveValue.hpp> // for DirectiveValueType
|
||||||
|
|
||||||
#include <string> // for string, basic_string
|
#include <string> // for string, basic_string
|
||||||
|
|
||||||
class BoolDirective : public ADirective
|
class BoolDirective : public ADirective
|
||||||
|
|||||||
@ -1,16 +1,16 @@
|
|||||||
#include "webserv/log/Log.hpp"
|
#include <webserv/config/directive/BoolDirective.hpp> // for BoolDirective
|
||||||
|
|
||||||
#include <webserv/config/directive/BoolDirective.hpp> // for BoolDirective
|
|
||||||
#include <webserv/config/directive/DirectiveFactory.hpp> // for DirectiveFactory
|
#include <webserv/config/directive/DirectiveFactory.hpp> // for DirectiveFactory
|
||||||
#include <webserv/config/directive/IntDirective.hpp> // for IntDirective
|
#include <webserv/config/directive/IntDirective.hpp> // for IntDirective
|
||||||
#include <webserv/config/directive/IntStringDirective.hpp> // for IntStringDirective
|
#include <webserv/config/directive/IntStringDirective.hpp> // for IntStringDirective
|
||||||
#include <webserv/config/directive/SizeDirective.hpp> // for SizeDirective
|
#include <webserv/config/directive/SizeDirective.hpp> // for SizeDirective
|
||||||
#include <webserv/config/directive/StringDirective.hpp> // for StringDirective
|
#include <webserv/config/directive/StringDirective.hpp> // for StringDirective
|
||||||
#include <webserv/config/directive/VectorDirective.hpp> // for VectorDirective
|
#include <webserv/config/directive/VectorDirective.hpp> // for VectorDirective
|
||||||
#include <webserv/config/utils.hpp> // for trim, trimSemi
|
#include <webserv/config/utils.hpp> // for trim, trimSemi
|
||||||
|
#include <sstream> // for basic_stringstream, stringstream
|
||||||
|
#include <stdexcept> // for invalid_argument
|
||||||
|
#include <utility> // for pair
|
||||||
|
|
||||||
#include <sstream> // for basic_stringstream, stringstream
|
#include "webserv/log/Log.hpp" // for LOCATION, Log
|
||||||
#include <stdexcept> // for invalid_argument
|
|
||||||
|
|
||||||
class ADirective;
|
class ADirective;
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
||||||
|
|
||||||
#include <array> // for array
|
#include <array> // for array
|
||||||
#include <functional> // for function
|
#include <functional> // for function
|
||||||
#include <memory> // for unique_ptr
|
#include <memory> // for unique_ptr
|
||||||
|
|||||||
@ -1,11 +1,9 @@
|
|||||||
#include <webserv/config/directive/ADirective.hpp> // for ADirective, operator<<
|
|
||||||
#include <webserv/config/directive/DirectiveValue.hpp>
|
#include <webserv/config/directive/DirectiveValue.hpp>
|
||||||
|
#include <cstddef> // for size_t
|
||||||
#include <cstddef> // for size_t
|
#include <string> // for string, basic_string, allocator, operator+, char_traits, to_string, operator<<
|
||||||
#include <string> // for string, basic_string, allocator, char_traits, operator+, to_string, operator<<
|
#include <utility> // for pair
|
||||||
#include <utility> // for pair
|
#include <variant> // for visit
|
||||||
#include <variant> // for visit
|
#include <vector> // for vector
|
||||||
#include <vector> // for vector
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
#include <webserv/config/directive/IntDirective.hpp> // for IntDirective
|
#include <webserv/config/directive/IntDirective.hpp> // for IntDirective
|
||||||
|
|
||||||
|
#include "webserv/config/directive/ADirective.hpp" // for ADirective
|
||||||
|
#include "webserv/config/directive/DirectiveValue.hpp" // for DirectiveValueType
|
||||||
|
|
||||||
IntDirective::IntDirective(const std::string &name, const std::string &value)
|
IntDirective::IntDirective(const std::string &name, const std::string &value)
|
||||||
: ADirective(name) // NOLINT(bugprone-easily-swappable-parameters)
|
: ADirective(name) // NOLINT(bugprone-easily-swappable-parameters)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
||||||
#include <webserv/config/directive/DirectiveValue.hpp> // for DirectiveValueType
|
#include <webserv/config/directive/DirectiveValue.hpp> // for DirectiveValueType
|
||||||
|
|
||||||
#include <string> // for string, basic_string
|
#include <string> // for string, basic_string
|
||||||
|
|
||||||
class IntDirective : public ADirective
|
class IntDirective : public ADirective
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
#include <webserv/config/directive/IntStringDirective.hpp> // for IntDirective
|
#include <webserv/config/directive/IntStringDirective.hpp> // for IntDirective
|
||||||
#include <webserv/config/utils.hpp> // for trim
|
#include <webserv/config/utils.hpp> // for trim
|
||||||
|
#include <sstream> // for basic_istringstream, basic_istream::operator>>, istringstream
|
||||||
|
|
||||||
#include <sstream> // for basic_istringstream, basic_istream::operator>>, istringstream
|
#include "webserv/config/directive/ADirective.hpp" // for ADirective
|
||||||
|
#include "webserv/config/directive/DirectiveValue.hpp" // for DirectiveValueType
|
||||||
|
|
||||||
IntStringDirective::IntStringDirective(const std::string &name, const std::string &value)
|
IntStringDirective::IntStringDirective(const std::string &name, const std::string &value)
|
||||||
: ADirective(name) // NOLINT(bugprone-easily-swappable-parameters)
|
: ADirective(name) // NOLINT(bugprone-easily-swappable-parameters)
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
||||||
#include <webserv/config/directive/DirectiveValue.hpp> // for DirectiveValueType
|
#include <webserv/config/directive/DirectiveValue.hpp> // for DirectiveValueType
|
||||||
|
|
||||||
#include <string> // for basic_string, string
|
#include <string> // for basic_string, string
|
||||||
#include <utility> // for pair
|
#include <utility> // for pair
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
#include <webserv/config/directive/SizeDirective.hpp> // for SizeDirective
|
#include <webserv/config/directive/SizeDirective.hpp> // for SizeDirective
|
||||||
#include <webserv/config/utils.hpp> // for trim
|
#include <webserv/config/utils.hpp> // for trim
|
||||||
|
#include <algorithm> // for __transform_fn, transform
|
||||||
|
#include <cctype> // for tolower
|
||||||
|
#include <stdexcept> // for invalid_argument
|
||||||
|
|
||||||
#include <algorithm> // for __transform_fn, transform
|
#include "webserv/config/directive/ADirective.hpp" // for ADirective
|
||||||
#include <cctype> // for tolower
|
#include "webserv/config/directive/DirectiveValue.hpp" // for DirectiveValueType
|
||||||
#include <stdexcept> // for invalid_argument
|
|
||||||
|
|
||||||
SizeDirective::SizeDirective(const std::string &name, const std::string &value)
|
SizeDirective::SizeDirective(const std::string &name, const std::string &value)
|
||||||
: ADirective(name) // NOLINT(bugprone-easily-swappable-parameters)
|
: ADirective(name) // NOLINT(bugprone-easily-swappable-parameters)
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
||||||
#include <webserv/config/directive/DirectiveValue.hpp> // for DirectiveValueType
|
#include <webserv/config/directive/DirectiveValue.hpp> // for DirectiveValueType
|
||||||
|
|
||||||
#include <cstddef> // for size_t
|
#include <cstddef> // for size_t
|
||||||
#include <string> // for string, basic_string
|
#include <string> // for string, basic_string
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
#include <webserv/config/directive/StringDirective.hpp> // for IntDirective
|
#include <webserv/config/directive/StringDirective.hpp> // for IntDirective
|
||||||
|
|
||||||
|
#include "webserv/config/directive/ADirective.hpp" // for ADirective
|
||||||
|
#include "webserv/config/directive/DirectiveValue.hpp" // for DirectiveValueType
|
||||||
|
|
||||||
StringDirective::StringDirective(const std::string &name, const std::string &value)
|
StringDirective::StringDirective(const std::string &name, const std::string &value)
|
||||||
: ADirective(name) // NOLINT(bugprone-easily-swappable-parameters)
|
: ADirective(name) // NOLINT(bugprone-easily-swappable-parameters)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
||||||
#include <webserv/config/directive/DirectiveValue.hpp> // for DirectiveValueType
|
#include <webserv/config/directive/DirectiveValue.hpp> // for DirectiveValueType
|
||||||
|
|
||||||
#include <string> // for string, basic_string
|
#include <string> // for string, basic_string
|
||||||
|
|
||||||
class StringDirective : public ADirective
|
class StringDirective : public ADirective
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
#include <webserv/config/directive/VectorDirective.hpp> // for IntDirective
|
#include <webserv/config/directive/VectorDirective.hpp> // for IntDirective
|
||||||
|
#include <sstream> // for basic_stringstream, stringstream
|
||||||
|
|
||||||
#include <sstream> // for basic_stringstream, stringstream
|
#include "webserv/config/directive/ADirective.hpp" // for ADirective
|
||||||
|
#include "webserv/config/directive/DirectiveValue.hpp" // for DirectiveValueType
|
||||||
|
|
||||||
VectorDirective::VectorDirective(const std::string &name, const std::string &value)
|
VectorDirective::VectorDirective(const std::string &name, const std::string &value)
|
||||||
: ADirective(name) // NOLINT(bugprone-easily-swappable-parameters)
|
: ADirective(name) // NOLINT(bugprone-easily-swappable-parameters)
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
#include <webserv/config/directive/ADirective.hpp> // for ADirective
|
||||||
#include <webserv/config/directive/DirectiveValue.hpp> // for DirectiveValueType
|
#include <webserv/config/directive/DirectiveValue.hpp> // for DirectiveValueType
|
||||||
|
|
||||||
#include <string> // for basic_string, string
|
#include <string> // for basic_string, string
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
|
|
||||||
#include <webserv/config/utils.hpp>
|
#include <webserv/config/utils.hpp>
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
#include <webserv/http/HttpConstants.hpp> // for CRLF
|
#include <webserv/http/HttpConstants.hpp> // for CRLF
|
||||||
#include <webserv/http/HttpHeaders.hpp> // for HttpHeaders
|
#include <webserv/http/HttpHeaders.hpp> // for HttpHeaders
|
||||||
#include <webserv/log/Log.hpp>
|
#include <webserv/log/Log.hpp>
|
||||||
|
|
||||||
#include <algorithm> // for __transform_fn, transform
|
#include <algorithm> // for __transform_fn, transform
|
||||||
#include <cctype> // for tolower
|
#include <cctype> // for tolower
|
||||||
#include <utility> // for pair
|
#include <utility> // for pair
|
||||||
|
|||||||
@ -1,15 +1,14 @@
|
|||||||
#include "webserv/config/utils.hpp" // for stoul
|
|
||||||
|
|
||||||
#include <webserv/http/HttpConstants.hpp> // for CRLF, DOUBLE_CRLF
|
#include <webserv/http/HttpConstants.hpp> // for CRLF, DOUBLE_CRLF
|
||||||
#include <webserv/http/HttpRequest.hpp>
|
#include <webserv/http/HttpRequest.hpp>
|
||||||
#include <webserv/log/Log.hpp> // for Log, LOCATION
|
#include <webserv/log/Log.hpp> // for Log, LOCATION
|
||||||
|
|
||||||
#include <map> // for map
|
#include <map> // for map
|
||||||
#include <optional> // for optional
|
#include <optional> // for optional
|
||||||
#include <sstream> // for basic_stringstream, basic_istream, stringstream
|
#include <sstream> // for basic_stringstream, basic_istream, stringstream
|
||||||
#include <utility> // for pair
|
#include <utility> // for pair
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
|
|
||||||
|
#include "webserv/config/utils.hpp" // for stoul
|
||||||
|
|
||||||
class ServerConfig;
|
class ServerConfig;
|
||||||
|
|
||||||
HttpRequest::HttpRequest(const ServerConfig *serverConfig, const Client *client)
|
HttpRequest::HttpRequest(const ServerConfig *serverConfig, const Client *client)
|
||||||
|
|||||||
@ -1,11 +1,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <webserv/config/ServerConfig.hpp>
|
#include <webserv/config/ServerConfig.hpp>
|
||||||
#include <webserv/http/HttpHeaders.hpp> // for HttpHeaders
|
#include <webserv/http/HttpHeaders.hpp> // for HttpHeaders
|
||||||
|
#include <cstddef> // for size_t
|
||||||
#include <cstddef> // for size_t
|
#include <cstdint> // for uint8_t
|
||||||
#include <cstdint> // for uint8_t
|
#include <string> // for string, basic_string
|
||||||
#include <string> // for string, basic_string
|
|
||||||
|
|
||||||
class Client;
|
class Client;
|
||||||
class ServerConfig;
|
class ServerConfig;
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
#include <webserv/log/Channel.hpp>
|
#include <webserv/log/Channel.hpp>
|
||||||
|
|
||||||
#include <iomanip> // for operator<<, setfill, setw
|
#include <iomanip> // for operator<<, setfill, setw
|
||||||
#include <sstream> // for basic_ostream, operator<<, basic_stringstream, basic_istream, basic_istringstream, right, istringstream, stringstream
|
#include <sstream> // for basic_ostream, operator<<, basic_stringstream, basic_istream, basic_istringstream, right, istringstream, stringstream
|
||||||
#include <utility> // for get
|
#include <utility> // for get
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <webserv/log/Log.hpp>
|
#include <webserv/log/Log.hpp>
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
#include <webserv/log/FileChannel.hpp>
|
#include <webserv/log/FileChannel.hpp>
|
||||||
#include <webserv/log/Log.hpp> // for Log
|
#include <webserv/log/Log.hpp> // for Log
|
||||||
|
|
||||||
#include <chrono> // for system_clock
|
#include <chrono> // for system_clock
|
||||||
#include <ctime> // for localtime, tm
|
#include <ctime> // for localtime, tm
|
||||||
#include <iomanip> // for operator<<, put_time
|
#include <iomanip> // for operator<<, put_time
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include <webserv/log/Channel.hpp> // for Channel
|
#include <webserv/log/Channel.hpp> // for Channel
|
||||||
#include <webserv/log/Log.hpp> // for Log
|
#include <webserv/log/Log.hpp> // for Log
|
||||||
|
|
||||||
#include <fstream> // for basic_ofstream, ios_base, ofstream
|
#include <fstream> // for basic_ofstream, ios_base, ofstream
|
||||||
#include <map> // for map
|
#include <map> // for map
|
||||||
#include <string> // for string, basic_string
|
#include <string> // for string, basic_string
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
#include <webserv/log/FileChannel.hpp> // for FileChannel
|
#include <webserv/log/FileChannel.hpp> // for FileChannel
|
||||||
#include <webserv/log/Log.hpp>
|
#include <webserv/log/Log.hpp>
|
||||||
#include <webserv/log/StdoutChannel.hpp> // for StdoutChannel
|
#include <webserv/log/StdoutChannel.hpp> // for StdoutChannel
|
||||||
|
|
||||||
#include <chrono> // for duration_cast, operator-, steady_clock, duration, seconds
|
#include <chrono> // for duration_cast, operator-, steady_clock, duration, seconds
|
||||||
#include <exception> // for exception
|
#include <exception> // for exception
|
||||||
#include <iostream> // for basic_ostream, operator<<, cerr
|
#include <iostream> // for basic_ostream, operator<<, cerr
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
#include <webserv/log/Log.hpp> // for Log
|
#include <webserv/log/Log.hpp> // for Log
|
||||||
#include <webserv/log/StdoutChannel.hpp>
|
#include <webserv/log/StdoutChannel.hpp>
|
||||||
|
|
||||||
#include <iomanip> // for operator<<, setfill, setw
|
#include <iomanip> // for operator<<, setfill, setw
|
||||||
#include <iostream> // for basic_ostream, operator<<, basic_ostream::operator<<, cerr, cout, flush, ostream
|
#include <iostream> // for basic_ostream, operator<<, basic_ostream::operator<<, cerr, cout, flush, ostream
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include <webserv/log/Channel.hpp> // for Channel
|
#include <webserv/log/Channel.hpp> // for Channel
|
||||||
#include <webserv/log/Log.hpp> // for Log
|
#include <webserv/log/Log.hpp> // for Log
|
||||||
|
|
||||||
#include <map> // for map
|
#include <map> // for map
|
||||||
#include <string> // for string, basic_string
|
#include <string> // for string, basic_string
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
#include <webserv/config/ConfigManager.hpp> // for ConfigManager
|
#include <webserv/config/ConfigManager.hpp> // for ConfigManager
|
||||||
#include <webserv/log/Log.hpp> // for Log, LOCATION
|
#include <webserv/log/Log.hpp> // for Log, LOCATION
|
||||||
#include <webserv/server/Server.hpp> // for Server
|
#include <webserv/server/Server.hpp> // for Server
|
||||||
|
|
||||||
#include <iostream> // for basic_ostream, operator<<, cerr, ios_base
|
#include <iostream> // for basic_ostream, operator<<, cerr, ios_base
|
||||||
#include <map> // for map
|
#include <map> // for map
|
||||||
#include <string> // for basic_string, char_traits, allocator, operator+, operator<=>
|
#include <string> // for basic_string, char_traits, allocator, operator+, operator<=>
|
||||||
|
|||||||
@ -1,22 +1,21 @@
|
|||||||
#include <webserv/client/Client.hpp> // for Client
|
#include <webserv/client/Client.hpp> // for Client
|
||||||
#include <webserv/config/ConfigManager.hpp> // for ConfigManager
|
#include <webserv/config/ConfigManager.hpp> // for ConfigManager
|
||||||
#include <webserv/log/Log.hpp> // for Log
|
#include <webserv/log/Log.hpp> // for Log
|
||||||
#include <webserv/server/Server.hpp>
|
#include <webserv/server/Server.hpp>
|
||||||
#include <webserv/socket/Socket.hpp> // for Socket
|
#include <webserv/socket/Socket.hpp> // for Socket
|
||||||
|
#include <sys/epoll.h> // for epoll_event, epoll_ctl, EPOLLIN, EPOLLOUT, epoll_create1, epoll_wait, EPOLLERR, EPOLLHUP, EPOLL_CTL_ADD, EPOLL_CTL_DEL, EPOLL_CTL_MOD
|
||||||
#include <cerrno> // for errno
|
#include <sys/socket.h> // for send, SOMAXCONN
|
||||||
#include <cstring> // for strerror, strlen
|
#include <sys/types.h> // for ssize_t
|
||||||
#include <exception> // for exception
|
#include <unistd.h> // for close
|
||||||
#include <memory> // for unique_ptr, allocator, make_unique
|
#include <webserv/config/ServerConfig.hpp> // for ServerConfig
|
||||||
#include <stdexcept> // for runtime_error
|
#include <cerrno> // for errno
|
||||||
#include <string> // for basic_string, operator+, to_string, char_traits, string
|
#include <cstring> // for strerror, strlen
|
||||||
#include <utility> // for move, pair
|
#include <exception> // for exception
|
||||||
#include <vector> // for vector
|
#include <memory> // for unique_ptr, allocator, make_unique
|
||||||
|
#include <stdexcept> // for runtime_error
|
||||||
#include <sys/epoll.h> // for epoll_event, epoll_ctl, EPOLLIN, EPOLLOUT, epoll_create1, epoll_wait, EPOLLERR, EPOLLHUP, EPOLL_CTL_ADD, EPOLL_CTL_DEL, EPOLL_CTL_MOD
|
#include <string> // for basic_string, operator+, to_string, char_traits, string
|
||||||
#include <sys/socket.h> // for send, SOMAXCONN
|
#include <utility> // for move, pair
|
||||||
#include <sys/types.h> // for ssize_t
|
#include <vector> // for vector
|
||||||
#include <unistd.h> // for close
|
|
||||||
|
|
||||||
Server::Server(const ConfigManager &configManager) : epoll_fd_(epoll_create1(0)), configManager_(configManager)
|
Server::Server(const ConfigManager &configManager) : epoll_fd_(epoll_create1(0)), configManager_(configManager)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,16 +3,16 @@
|
|||||||
#include <webserv/client/Client.hpp>
|
#include <webserv/client/Client.hpp>
|
||||||
#include <webserv/config/ConfigManager.hpp>
|
#include <webserv/config/ConfigManager.hpp>
|
||||||
#include <webserv/config/ServerConfig.hpp> // for ServerConfig
|
#include <webserv/config/ServerConfig.hpp> // for ServerConfig
|
||||||
#include <webserv/socket/Socket.hpp> // for Socket
|
#include <webserv/socket/Socket.hpp> // for Socket
|
||||||
|
#include <cstdint> // for uint32_t
|
||||||
#include <cstdint> // for uint32_t
|
#include <functional> // for reference_wrapper
|
||||||
#include <functional> // for reference_wrapper
|
#include <memory> // for unique_ptr
|
||||||
#include <memory> // for unique_ptr
|
#include <unordered_map> // for unordered_map
|
||||||
#include <unordered_map> // for unordered_map
|
#include <vector> // for vector
|
||||||
#include <vector> // for vector
|
|
||||||
|
|
||||||
class Client;
|
class Client;
|
||||||
class ConfigManager;
|
class ConfigManager;
|
||||||
|
class ServerConfig;
|
||||||
|
|
||||||
class Server
|
class Server
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,14 +1,12 @@
|
|||||||
#include <webserv/log/Log.hpp>
|
#include <webserv/log/Log.hpp>
|
||||||
#include <webserv/socket/Socket.hpp>
|
#include <webserv/socket/Socket.hpp>
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include <stdexcept>
|
|
||||||
|
|
||||||
#include <arpa/inet.h> // For inet_addr
|
#include <arpa/inet.h> // For inet_addr
|
||||||
#include <fcntl.h> // For fcntl()"
|
#include <fcntl.h> // For fcntl()"
|
||||||
#include <netinet/in.h> // For sockaddr_in
|
#include <netinet/in.h> // For sockaddr_in
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <unistd.h> // For close()
|
#include <unistd.h> // For close()
|
||||||
|
#include <memory>
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
Socket::Socket() : fd_(socket(AF_INET, SOCK_STREAM, 0))
|
Socket::Socket() : fd_(socket(AF_INET, SOCK_STREAM, 0))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,11 +1,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <sys/types.h> // for ssize_t
|
||||||
#include <cstddef> // for size_t
|
#include <cstddef> // for size_t
|
||||||
#include <memory> // for unique_ptr
|
#include <memory> // for unique_ptr
|
||||||
#include <string> // for string
|
#include <string> // for string
|
||||||
|
|
||||||
#include <sys/types.h> // for ssize_t
|
|
||||||
|
|
||||||
class Socket
|
class Socket
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user