hunyadi-dev commented on a change in pull request #885:
URL: https://github.com/apache/nifi-minifi-cpp/pull/885#discussion_r483661338
##########
File path: libminifi/src/core/FlowConfiguration.cpp
##########
@@ -67,33 +67,24 @@ std::shared_ptr<core::Processor>
FlowConfiguration::createProvenanceReportTask()
return processor;
}
-std::unique_ptr<core::ProcessGroup> FlowConfiguration::updateFromPayload(const
std::string &source, const std::string &yamlConfigPayload) {
+std::unique_ptr<core::ProcessGroup> FlowConfiguration::updateFromPayload(const
std::string& url, const std::string& yamlConfigPayload) {
auto old_services = controller_services_;
auto old_provider = service_provider_;
controller_services_ =
std::make_shared<core::controller::ControllerServiceMap>();
service_provider_ =
std::make_shared<core::controller::StandardControllerServiceProvider>(controller_services_,
nullptr, configuration_);
auto payload = getRootFromPayload(yamlConfigPayload);
- if (!source.empty() && payload != nullptr) {
- std::string host, protocol, path, query, url = source;
- int port = -1;
- utils::parse_url(&url, &host, &port, &protocol, &path, &query);
-
+ if (!url.empty() && payload != nullptr) {
std::string flow_id, bucket_id;
- auto path_split = utils::StringUtils::split(path, "/");
- for (size_t i = 0; i < path_split.size(); i++) {
- const std::string &str = path_split.at(i);
- if (str == "flows") {
- if (i + 1 < path_split.size()) {
- flow_id = path_split.at(i + 1);
- i++;
- }
- }
-
- if (str == "bucket") {
- if (i + 1 < path_split.size()) {
- bucket_id = path_split.at(i + 1);
- i++;
- }
+ auto path_split = utils::StringUtils::split(url, "/");
+ // This function might not do what the original implementater expected
from it (https://issues.apache.org/jira/browse/MINIFICPP-1344)
Review comment:
Deleted line.
----------------------------------------------------------------
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]