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

Code refactoried a little bit from previous merge #43

Merged
merged 5 commits into from
Dec 1, 2020

Conversation

cong1920
Copy link
Contributor

This change includes:

  1. Check if serve path is a directory other than file and use its real path to capture to serve;
  2. Use C++ RAII other than memory on stack to hold returned real path from the realpath() calls;
  3. Added few more test cases.

… the root cause, but I can add one line test code to prove and track it for now. Well while I was adding such line and compiling, I got a compiler warning about the std::tmpnam(nullptr) therefore I just made few more changes to replace it with mkdtemp, and a wrapper to ensure temporary folder is deleted always.
…lude: 1) Check if serve path is directory other than file; 2) Use C++ RAII other than memory on stack to hold returned real path from realpath(); 3) Added few more test cases.
Copy link
Owner

@matt-42 matt-42 left a comment

Choose a reason for hiding this comment

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

Thanks for the work @cong1920.

…other than dynamically allocating/de-allocating every time a static file is requested.
Copy link
Owner

@matt-42 matt-42 left a comment

Choose a reason for hiding this comment

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

Looks good !

@matt-42 matt-42 merged commit 667f439 into matt-42:master Dec 1, 2020
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.

2 participants