-
Notifications
You must be signed in to change notification settings - Fork 2
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
[feat] Implement Location #9
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Edit redirection value of location /obst/ for better readability.
- Temporarly, changed all properties for Location into public for development purpose. - Changed data type of _redirectCode from int to string. - Added new constructors for Location class.
- Updated Config to have a map of Location pointer, not the value, to allocate Location in memory dynamically. - Added Sample Location objects in Config for dev purpose. - Updated Config destructor to delete Location instances in Config._locationMap.
- Added volatile bool g_sigint global variable haveing default value as 'false', and turn it into 'true' when sigint been sent. - Added this feature to prevent 'still reachable' memory remain after the program exit() with SIGINT handler. - Server::start() will check g_sigint value during loop, and when g_sigint turn to 'true', program will break from the loop and call Server::stop(). - By exiting server.start(), the program will exit with return value 0. And this will prevent 'still reachable' memory issue. - Added lines of code to apply and set initial value for Server constructor. - Added lines of code in Server:stop() method to clear and remove remaining values.
- Implemented methods of Location class. - Added lines of code in constructor to set initial values. - Added new methods and a property, _isListdir.
- Updated the constructor to have intial value. - Implemented code blocks to parse and store Location. - Removed sample Locations code block. - Added new method getErrorPage(const int code) to return error page for certain HTTP response code for error. - Added new method getLocation(const std::string key) to return Location\*.
- Restored private properties that were in public for a moment, before the implementation of Location class.
miooo0o
approved these changes
Jul 26, 2024
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 received the PR, applied it, and tested it. It works properly. There is a problem in the build errors due to circular dependency, but I fixed it in my branch. I will use it and send it in the next PR.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implemented Location class related functionalities.
Updated constructors of classes to set initial values.
Added a global variable to handle SIGINT.
still reachable
memory issue, not to happen.