adam-markovics commented on a change in pull request #1284:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1284#discussion_r832043146



##########
File path: libminifi/src/c2/ControllerSocketProtocol.cpp
##########
@@ -180,14 +178,18 @@ void 
ControllerSocketProtocol::initialize(core::controller::ControllerServicePro
             resp.write(response.str());
             stream->write(resp.getBuffer());
           } else if (what == "components") {
+            std::vector<std::pair<std::string, bool>> components;
+            
update_sink_->executeOnAllComponents([&components](state::StateController* 
component){
+              components.emplace_back(component->getComponentName(), 
component->isRunning());
+            });
             io::BufferStream resp;
             resp.write(&head, 1);
-            const auto size_ = 
gsl::narrow<uint16_t>(update_sink_->getAllComponents().size());
-            resp.write(size_);
-            for (const auto &component : update_sink_->getAllComponents()) {
-              resp.write(component->getComponentName());
-              resp.write(component->isRunning() ? "true" : "false");
+            
resp.write(gsl::narrow<uint16_t>(gsl::narrow<uint16_t>(components.size())));

Review comment:
       Oops, yes. :)




-- 
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]


Reply via email to