lots of log message and fixed bad_file_descriptor issue

This commit is contained in:
hugogogo
2022-08-22 01:50:28 +02:00
parent 469eca8aa9
commit 5225e3258b
18 changed files with 186 additions and 112 deletions

View File

@@ -282,10 +282,10 @@ void Client::clear_cgi_vars()
void Client::print_client(std::string message)
{
std::map<std::string, std::string>::iterator it;
std::cout << "\n=== DEBUG PRINT CLIENT ===\n";
std::cout << message << ":\n----------\n\n" << "raw_request:\n__\n";
std::cerr << "\n=== DEBUG PRINT CLIENT ===\n";
std::cerr << message << ":\n----------\n\n" << "raw_request:\n__\n";
::print_special(raw_request);
std::cout << "\n__\n"
std::cerr << "\n__\n"
<< "get_cl_fd() : [" << get_cl_fd() << "]\n"
<< "get_cl_port() : [" << get_cl_port() << "]\n"
<< "get_cl_ip() : [" << get_cl_ip() << "]\n"
@@ -299,8 +299,8 @@ std::cout << "\n=== DEBUG PRINT CLIENT ===\n";
<< "get_rq_script_info() : [" << get_rq_script_info() << "]\n"
<< "headers :\n";
for (it = _request.headers.begin(); it != _request.headers.end(); it++)
std::cout << " " << it->first << ": [" << it->second << "]\n";
std::cout << "\n=== END PRINT CLIENT ===\n\n";
std::cerr << " " << it->first << ": [" << it->second << "]\n";
std::cerr << "\n=== END PRINT CLIENT ===\n\n";
}
/*********************************************
@@ -508,7 +508,6 @@ If we get a url that ends in / ignore the last /
for (std::vector<LocationConfig>::const_iterator it = server.locations.begin(); it != server.locations.end(); it++)
{
// std::cout << it->path << " -- ";
if (it->path.size() > uri.size())
continue ;