Brief code-review #61
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello @kdeng00 ,
I am Leonid, author of oatpp.
Just stumbled upon your project and was happy to notice that you are using oatpp.
I briefly looked through the controllers code and I have some comments/tips for you:
oatpp::Stringis already using shared_ptr under the hood, so there is no need to make it shared here.Just use it directly:
Here you may opt to use oatpp streaming API (which is not documented yet - unfortunately) in order to stream file contents directly from file - without loading IT into RAM.
In order to do so - take a look at ChunkedBody. Basically what you need is to provide your own ReadCallback to the
ChunkedBody.ReadCallbackwill request you for the next chunk of data (here) giving you buffer that you have to fill. All you need - is to read next chunk of data from the file to this provided buffer.There is a PR with new Authorization feature which is about to be merged to master.
You may opt to use this newly introduced
AUTHORIZATIONannotation macro in order to enhance your auth functionality.Please feel free to contact me in case of any questions - through the Github issues or in the dev-chat on gitter.
Cheers!
Leonid
Hey @lganzzzo, thanks for the tips and the comments are welcomed! I was actually thinking about bringing up Authorization on the gitter chat but it seems like it's already at the point where there is a PR. I believe it's a great thing you're doing with oatpp, it's rare to find something like this that is so well documented and robust.
Hey @kdeng00 ,
Thank you for the feedback! I am happy that oatpp can help your project!