add Class Respons Request

This commit is contained in:
Talyx
2022-01-25 18:45:15 +03:00
parent e7f32c96e5
commit 2f0b3bddbe
12 changed files with 565 additions and 305 deletions

View File

@@ -52,8 +52,8 @@ void Server::setNonblocking(int fd)
void Server::newConnection(int fd)
{
struct epoll_event ev;
ev.events = EPOLLIN | EPOLLOUT | EPOLLET;
ev.data.fd = fd;
ev.events = EPOLLIN | EPOLLOUT | EPOLLET;
epoll_ctl(_epolfd, EPOLL_CTL_ADD, fd, &ev);
_client++;
@@ -77,7 +77,6 @@ void Server::start(void)
code = header.parseRequest();
header.printHeaderInfo();
header.sendRespons(fd_accept);
std::cout << BLUE << header.getReasonPhrase(code) << ZERO_C << std::endl;
close(fd_accept);
close(serverSocket.getSocketFd());
//-----------------------------------------------попытка добавить epoll------------------

View File

@@ -255,7 +255,6 @@ void ServerConfig::fillFields(void)
ret = identify(block);
++block;
}
// printFields();
}
void ServerConfig::printFields(void)
@@ -291,14 +290,14 @@ void ServerConfig::printFields(void)
}
std::cout << std::endl;
it3 = (*it).redirect.begin();
std::cout << YELLOW << "redirection" << BLUE << " " << it3->first << " " << it3->second << std::endl;
std::cout << YELLOW << "redirection" << RED << " " << it3->first << " " << BLUE << it3->second << std::endl;
++it;
std::cout << PINK << "------------------------------------------------\n";
}
std::cout << GREEN << "error pages" << std::endl;
while (it1 != _errorPages.end())
{
std::cout << BLUE << it1->first << " " << it1->second << std::endl;
std::cout << YELLOW << it1->first << " " << BLUE << it1->second << std::endl;
++it1;
}
std::cout << RED << "-------------------------Server-End------------------------------------\n" << ZERO_C;