martinzink commented on code in PR #1457:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1457#discussion_r1085083897
##########
extensions/standard-processors/processors/NetworkListenerProcessor.cpp:
##########
@@ -66,16 +66,16 @@ void NetworkListenerProcessor::startTcpServer(const
core::ProcessContext& contex
auto options = readServerOptions(context);
std::string ssl_value;
+ std::optional<utils::net::SslServerOptions> ssl_options;
if (context.getProperty(ssl_context_property.getName(), ssl_value) &&
!ssl_value.empty()) {
auto ssl_data = utils::net::getSslData(context, ssl_context_property,
logger_);
if (!ssl_data || !ssl_data->isValid()) {
throw Exception(PROCESSOR_EXCEPTION, "SSL Context Service is set, but no
valid SSL data was found!");
}
- auto client_auth =
utils::parseEnumProperty<utils::net::SslServer::ClientAuthOption>(context,
client_auth_property);
- server_ = std::make_unique<utils::net::SslServer>(options.max_queue_size,
options.port, logger_, *ssl_data, client_auth);
- } else {
- server_ = std::make_unique<utils::net::TcpServer>(options.max_queue_size,
options.port, logger_);
+ auto client_auth =
utils::parseEnumProperty<utils::net::ClientAuthOption>(context,
client_auth_property);
+ ssl_options.emplace(utils::net::SslServerOptions{std::move(*ssl_data),
client_auth});
Review Comment:
You are right, however this doesnt compile on clang without introducing a
ctor to the struct. (in theory this should work on c++20, but clang doesnt seem
to support it yet) Anyways, I've added this and the required ctor in
https://github.com/apache/nifi-minifi-cpp/pull/1457/commits/f37cffb3fe783683d38646b198dfc38f7a439ce4#diff-ddc009fae67709576613f5bd31e984c01c5bd4e4238a864cb14ebffa9f9368d3R76
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]