瀏覽代碼

Handle GotoMin messages

Ultimately the handling will be more interesting than this.  For now
though, we don't support them, and so we Shall reject them.
Clara Hobbs 7 年之前
父節點
當前提交
b0f00e2161
共有 1 個文件被更改,包括 10 次插入0 次删除
  1. 10
    0
      src/policy_engine.c

+ 10
- 0
src/policy_engine.c 查看文件

@@ -263,9 +263,19 @@ static enum policy_engine_state pe_sink_ready(void)
263 263
                 chPoolFree(&pdb_msg_pool, policy_engine_message);
264 264
                 policy_engine_message = NULL;
265 265
                 return PESinkSendReject;
266
+            /* Reject GotoMin messages
267
+             * Until we actually support GiveBack, this is the correct
268
+             * behavior according to S. 6.3.4 */
269
+            } else if (PD_MSGTYPE_GET(policy_engine_message) == PD_MSGTYPE_GOTOMIN
270
+                    && PD_NUMOBJ_GET(policy_engine_message) == 0) {
271
+                chPoolFree(&pdb_msg_pool, policy_engine_message);
272
+                policy_engine_message = NULL;
273
+                return PESinkSendReject;
266 274
             /* Evaluate new Source_Capabilities */
267 275
             } else if (PD_MSGTYPE_GET(policy_engine_message) == PD_MSGTYPE_SOURCE_CAPABILITIES
268 276
                     && PD_NUMOBJ_GET(policy_engine_message) > 0) {
277
+                /* Don't free the message: we need to keep the
278
+                 * Source_Capabilities message so we can evaluate it. */
269 279
                 return PESinkEvalCap;
270 280
             /* Give sink capabilities when asked */
271 281
             } else if (PD_MSGTYPE_GET(policy_engine_message) == PD_MSGTYPE_GET_SINK_CAP

Loading…
取消
儲存