-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dtolmaco/add debug log #388
Conversation
Ready to be merged! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I commented in the code: but good job!
include/webserv.hpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? I just added defines for timeouts
@@ -46,18 +45,19 @@ void CGIHandler::handleRequest(HTTPRequest &request, HTTPResponse &response) | |||
// TODO: it should be hardcoded | |||
response.setBody("500 Internal Server Error"); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this TODO? Why we need to set the body, if we already set the statusCode, which is associated with a certain message? We can probably imporove setStatusCode or create a Wrapper for both of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dunno. It was added a long time ago. I guess we can remove it now
} | ||
|
||
bool CGIHandler::executeCGI(const MetaVariables &env, HTTPResponse &response) | ||
{ | ||
std::cout << RED << "Entering CGIHandler::executeCGI" << RESET << std::endl; | ||
Debug::log("CGIHandler::executeCGI", Debug::CGI); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my branch https there is a new version of Debug::log taking also colors. Maybe you can cherry pick the commit(s) from that branch without the SSL stuff, like git cherry-pick -n <HASH>
the -n flag is to cherry pick without committing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets do it in your PR, when we gonna merge this one
@@ -157,7 +157,7 @@ bool CGIHandler::executeCGI(const MetaVariables &env, HTTPResponse &response) | |||
// execve(argvPointers[0], argvPointers.data(), envpPointers.data()); | |||
if (execve(argvPointers[0], argvPointers.data(), envpPointers.data()) == -1) | |||
{ | |||
perror("execve"); | |||
Debug::log("CGIHandler: execve failed", Debug::CGI); | |||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perror gives extra information and this way we are losing them. Please provide a Debug::log version that integrates the perror functionalities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright
src/ServerSocket.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove my logs here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we added them when it was not working properly, now it works fine
Currently working on 503(Service Unavailable): NGINX allows you to manage the number of simultaneous client connections using the limit_conn module. When the connection limit is exceeded, NGINX will return a 503 Service Unavailable status code, helping to protect your server from being overwhelmed by too many concurrent connections |
503 finished! I wrote explanation here https://linear.app/web-serv/issue/WEB-340/503-service-unavailable-too-many-requests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LPGTM
No description provided.