szaszm commented on a change in pull request #740: MINIFICPP-1144 - Fix
HTTPCallback freeze and refactor class
URL: https://github.com/apache/nifi-minifi-cpp/pull/740#discussion_r380734221
##########
File path: libminifi/include/utils/HTTPClient.h
##########
@@ -201,15 +209,18 @@ class HTTPRequestResponse {
*/
static size_t send_write(char * data, size_t size, size_t nmemb, void * p) {
- if (p != 0) {
- HTTPUploadCallback *callback = (HTTPUploadCallback*) p;
- if (callback->stop)
+ try {
+ if (p == nullptr) {
+ return 0x10000000;
+ }
+ HTTPUploadCallback *callback = (HTTPUploadCallback *) p;
Review comment:
Use `reinterpret_cast`
http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es49-if-you-must-use-a-cast-use-a-named-cast
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services