szaszm commented on a change in pull request #713: MINIFICPP-1119 unify
win/posix sockets + clean up issues
URL: https://github.com/apache/nifi-minifi-cpp/pull/713#discussion_r376018992
##########
File path: libminifi/src/io/StreamFactory.cpp
##########
@@ -76,9 +77,8 @@ class SocketCreator : public AbstractStreamFactory {
std::unique_ptr<Socket> createSecureSocket(const std::string &host, const
uint16_t port, const std::shared_ptr<minifi::controllers::SSLContextService>
&ssl_service) {
#ifdef OPENSSL_SUPPORT
if (ssl_service != nullptr) {
- auto ptr = std::make_shared<TLSContext>(configuration_, ssl_service);
- TLSSocket *socket = new TLSSocket(ptr, host, port);
- return std::unique_ptr<Socket>(socket);
+ auto context = std::make_shared<TLSContext>(configuration_, ssl_service);
+ return utils::make_unique<TLSSocket>(context, host, port);
} else {
Review comment:
got rid of the `else` branch and much more
----------------------------------------------------------------
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