Skip to content
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

Merged
merged 18 commits into from
May 24, 2024
Merged

Dtolmaco/add debug log #388

merged 18 commits into from
May 24, 2024

Conversation

dantol29
Copy link
Owner

No description provided.

@dantol29 dantol29 marked this pull request as ready for review May 22, 2024 12:29
@dantol29 dantol29 requested review from 552020 and lmangall May 23, 2024 14:55
@dantol29
Copy link
Owner Author

Ready to be merged!

Copy link
Collaborator

@552020 552020 left a 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!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change here?

Copy link
Owner Author

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");
}
Copy link
Collaborator

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.

Copy link
Owner Author

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);
Copy link
Collaborator

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.

Copy link
Owner Author

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;
Copy link
Collaborator

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.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright

Copy link
Collaborator

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?

Copy link
Owner Author

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

@dantol29
Copy link
Owner Author

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

@dantol29
Copy link
Owner Author

Copy link
Collaborator

@lmangall lmangall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

@dantol29 dantol29 requested a review from 552020 May 24, 2024 14:33
Copy link
Collaborator

@552020 552020 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LPGTM

@552020 552020 merged commit 35e9e05 into main May 24, 2024
2 checks passed
@552020 552020 deleted the dtolmaco/add-debug-log branch May 24, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants