|
28 | 28 | #include "dds/ddsi/ddsi_entity.h" |
29 | 29 | #include "dds/ddsi/ddsi_endpoint.h" |
30 | 30 | #include "dds/ddsi/ddsi_entity_index.h" |
| 31 | +#include "dds/ddsi/ddsi_misc.h" |
31 | 32 | #include "dds/ddsi/ddsi_thread.h" |
32 | 33 | #include "dds/ddsi/ddsi_sertype.h" |
33 | 34 | #include "dds/ddsi/ddsi_iid.h" |
@@ -587,17 +588,18 @@ dds_entity_t dds_create_topic_impl ( |
587 | 588 | // Check if the topic is in the forbiddenTopics or NOT in the onlyForTopics list, depending |
588 | 589 | // on which one is used. |
589 | 590 | // First off, topics not mentioned are allowed iff only_for_topics is unused |
590 | | - bool allowed_by_config = !psmx->only_for_topics[0]; |
| 591 | + bool allowed_by_config = psmx->only_for_topics[0] == NULL; |
591 | 592 | // Then any topic in only_for_topics is allowed |
592 | | - for (char **topic = psmx->only_for_topics; *topic; topic++) { |
593 | | - if (strcmp(ktp->name, *topic) == 0) { |
| 593 | + for (char **pattern = psmx->only_for_topics; *pattern; pattern++) { |
| 594 | + printf("Matching %s against pattern %s\n", ktp->name, *pattern); |
| 595 | + if (ddsi_patmatch(*pattern, ktp->name)) { |
594 | 596 | allowed_by_config = true; |
595 | 597 | break; |
596 | 598 | } |
597 | 599 | } |
598 | 600 | // And any topic in forbidden_topics is forbidden |
599 | | - for (char **topic = psmx->forbidden_topics; *topic; topic++) { |
600 | | - if (strcmp(ktp->name, *topic) == 0) { |
| 601 | + for (char **pattern = psmx->forbidden_topics; *pattern; pattern++) { |
| 602 | + if (ddsi_patmatch(*pattern, ktp->name)) { |
601 | 603 | allowed_by_config = false; |
602 | 604 | break; |
603 | 605 | } |
|
0 commit comments