提交 c70c32d3 authored 作者: Mike Jerris's avatar Mike Jerris

Merge pull request #146 in FS/freeswitch from…

Merge pull request #146 in FS/freeswitch from ~DDRAGIC/freeswitch:bugfix/FS-7121-switch_events_match-matches-any-substring to master

* commit '1c16d5d8':
  FS-7121 change switch_events_match() to use strcmp
......@@ -240,15 +240,15 @@ static int switch_events_match(switch_event_t *event, switch_event_node_t *node)
if (!strncasecmp(node->subclass_name, "file:", 5)) {
char *file_header;
if ((file_header = switch_event_get_header(event, "file")) != 0) {
match = strstr(node->subclass_name + 5, file_header) ? 1 : 0;
match = !strcmp(node->subclass_name + 5, file_header) ? 1 : 0;
}
} else if (!strncasecmp(node->subclass_name, "func:", 5)) {
char *func_header;
if ((func_header = switch_event_get_header(event, "function")) != 0) {
match = strstr(node->subclass_name + 5, func_header) ? 1 : 0;
match = !strcmp(node->subclass_name + 5, func_header) ? 1 : 0;
}
} else if (event->subclass_name && node->subclass_name) {
match = strstr(event->subclass_name, node->subclass_name) ? 1 : 0;
match = !strcmp(event->subclass_name, node->subclass_name) ? 1 : 0;
}
} else if ((event->subclass_name && !node->subclass_name) || (!event->subclass_name && !node->subclass_name)) {
match = 1;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论