refactor: remove unused Router references from Client and Server classes
This commit is contained in:
parent
3a95041815
commit
68ea191460
@ -97,8 +97,6 @@ std::vector<uint8_t> Client::getResponse() const
|
||||
{
|
||||
Log::trace(LOCATION);
|
||||
|
||||
const Router &router = server_.getRouter();
|
||||
static_cast<void>(router); // Suppress unused variable warning
|
||||
auto response = Router::handleRequest(*httpRequest_);
|
||||
return response->toBytes();
|
||||
}
|
||||
@ -8,7 +8,6 @@
|
||||
#include <webserv/http/HttpResponse.hpp> // for HttpResponse
|
||||
#include <webserv/server/Server.hpp>
|
||||
#include <webserv/socket/ClientSocket.hpp> // for ClientSocket
|
||||
#include <webserv/socket/ClientSocket.hpp>
|
||||
|
||||
#include <cstddef> // for size_t
|
||||
#include <cstdint> // for uint8_t
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
class Router;
|
||||
|
||||
Server::Server(const ConfigManager &configManager)
|
||||
: epoll_fd_(epoll_create1(0)), configManager_(configManager), router_()
|
||||
: epoll_fd_(epoll_create1(0)), configManager_(configManager)
|
||||
{
|
||||
Log::trace(LOCATION);
|
||||
const auto &serverConfigs = configManager.getServerConfigs();
|
||||
@ -244,8 +244,3 @@ void Server::run()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const Router &Server::getRouter() const
|
||||
{
|
||||
return router_;
|
||||
}
|
||||
@ -43,12 +43,10 @@ class Server
|
||||
|
||||
ServerSocket &getListener(int fd) const;
|
||||
Client &getClient(int fd) const;
|
||||
const Router &getRouter() const;
|
||||
|
||||
private:
|
||||
int epoll_fd_;
|
||||
const ConfigManager &configManager_;
|
||||
const Router router_;
|
||||
std::vector<std::unique_ptr<ServerSocket>> listeners_;
|
||||
std::set<int> listener_fds_;
|
||||
// std::unordered_map<int, std::unique_ptr<Client>> clients_;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user