bakaid commented on a change in pull request #708: MINIFICPP-1118 - MiNiFi C++
on Windows stops running in a secure env …
URL: https://github.com/apache/nifi-minifi-cpp/pull/708#discussion_r366225959
##########
File path: libminifi/src/io/tls/TLSSocket.cpp
##########
@@ -182,7 +182,15 @@ int16_t TLSSocket::initialize(bool blocking) {
setNonBlocking();
logger_->log_trace("Initializing TLSSocket %d", is_server);
int16_t ret = context_->initialize(is_server);
- Socket::initialize();
+
+ if (ret == 0) {
Review comment:
This control flow is not very readable this way, with `ret` controlling what
parts of the code run, sometimes with `== 0`, sometimes with `!= 0` and
sometimes with `!ret`. Is there a reason we can't just log and `return -1` each
time something fails? I think it would be more readable and would require less
nested ifs.
----------------------------------------------------------------
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