[GitHub] [nifi-minifi-cpp] arpadboda commented on a change in pull request #708: MINIFICPP-1118 - MiNiFi C++ on Windows stops running in a secure env …

2020-01-14 Thread GitBox
arpadboda 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_r366343751
 
 

 ##
 File path: libminifi/src/io/tls/TLSSocket.cpp
 ##
 @@ -182,9 +187,19 @@ 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 && listeners_ == 0) {
+  if (ret != 0) {
+logger_->log_warn("Failed to initialize SSL context!");
+return -1;
+  }
+
+  ret = Socket::initialize();
+  if (ret != 0) {
+logger_->log_warn("Failed to initialise basic socket for TLS socket");
+return -1;
 
 Review comment:
   Unified loggers to only have one.
   Made context init reentrant. 


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [nifi-minifi-cpp] arpadboda commented on a change in pull request #708: MINIFICPP-1118 - MiNiFi C++ on Windows stops running in a secure env …

2020-01-14 Thread GitBox
arpadboda 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_r366255579
 
 

 ##
 File path: libminifi/src/io/tls/TLSSocket.cpp
 ##
 @@ -200,17 +208,12 @@ int16_t TLSSocket::initialize(bool blocking) {
 logger_->log_trace("want read");
 return 0;
   } else {
+logger_->log_error("SSL socket connect failed to %s %d", 
requested_hostname_, port_);
+SSL_free(ssl_);
+ssl_ = NULL;
+Socket::closeStream();
 
 Review comment:
   Dtor cleans up anyway, but I was not brave enough to assume that socket 
objects are never reused. :) 
   
   Simplified cleanup logic anyway. 


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [nifi-minifi-cpp] arpadboda commented on a change in pull request #708: MINIFICPP-1118 - MiNiFi C++ on Windows stops running in a secure env …

2020-01-14 Thread GitBox
arpadboda 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_r366255210
 
 

 ##
 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:
   Fair point, simplified a bit. 


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:
us...@infra.apache.org


With regards,
Apache Git Services