ChugR commented on a change in pull request #472: Dispatch 1288 1 - policy for 
outbound connectors
URL: https://github.com/apache/qpid-dispatch/pull/472#discussion_r267883009
 
 

 ##########
 File path: src/policy.c
 ##########
 @@ -1083,15 +1119,21 @@ void qd_policy_amqp_open(qd_connection_t *qd_conn) {
         }
 
         if (qd_policy_open_lookup_user(policy, qd_conn->user_id, hostip, 
vhost, conn_name,
-                                       settings_name, SETTINGS_NAME_SIZE, 
conn_id,
-                                       qd_conn->policy_settings) &&
+                                       settings_name, SETTINGS_NAME_SIZE, 
conn_id) &&
             settings_name[0]) {
             // This connection is allowed by policy.
             // Apply transport policy settings
-            if (qd_conn->policy_settings->maxFrameSize > 0)
-                pn_transport_set_max_frame(pn_trans, 
qd_conn->policy_settings->maxFrameSize);
-            if (qd_conn->policy_settings->maxSessions > 0)
-                pn_transport_set_channel_max(pn_trans, 
qd_conn->policy_settings->maxSessions - 1);
+            if (qd_policy_open_fetch_settings(policy, qd_conn->user_id, 
hostip, vhost, conn_name,
+                                        settings_name, conn_id,
+                                        qd_conn->policy_settings)) {
+                if (qd_conn->policy_settings->maxFrameSize > 0)
+                    pn_transport_set_max_frame(pn_trans, 
qd_conn->policy_settings->maxFrameSize);
+                if (qd_conn->policy_settings->maxSessions > 0)
+                    pn_transport_set_channel_max(pn_trans, 
qd_conn->policy_settings->maxSessions - 1);
+            } else {
+                // failed to fetch settings
+                connection_allowed = false;
 
 Review comment:
   The common pattern in dispatch C code is if any qd_entity_get call fails 
then the entity in question is failed. Same goes for connector connection 
policy: if the policy does not load then that connection is denied. Pre-loading 
the policy is a separate issue. Suppose there was a preload that failed then 
all the connections using that failed preload must fail as well.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to