szaszm commented on code in PR #2112:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2112#discussion_r3167557854


##########
extensions/gcp/processors/GCSProcessor.cpp:
##########
@@ -48,13 +48,46 @@ void GCSProcessor::onSchedule(core::ProcessContext& 
context, core::ProcessSessio
   endpoint_url_ = context.getProperty(EndpointOverrideURL) | 
utils::toOptional();
   if (endpoint_url_)
     logger_->log_debug("Endpoint overwritten: {}", *endpoint_url_);
+
+  auto proxy_controller_service = 
minifi::utils::parseOptionalControllerService<minifi::controllers::ProxyConfigurationServiceInterface>(context,
 ProxyConfigurationService, getUUID());
+  if (proxy_controller_service) {
+    if (proxy_controller_service->getProxyType() == 
minifi::controllers::ProxyType::DIRECT) {
+      logger_->log_debug("Proxy configuration service indicates DIRECT 
connection, no proxy will be used for GCS processor");
+      return;
+    }

Review Comment:
   This `return` seems error-prone to me in the middle of a function that has 
more than one responsibility. I can imagine adding another property and its 
reading to the end of onSchedule later, and it would accidentally get skipped 
when the ProxyControllerService is configured to DIRECT.
   ```suggestion
     if (proxy_controller_service && proxy_controller_service->getProxyType() 
!= minifi::controllers::ProxyType::DIRECT) {
   ```



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