- list_for_each_entry(ev, &catch_all, catchall.list) {
- /* do not loop back events */
- if (ev->obj->client == cl)
- continue;
+ data = attr[EVMSG_DATA];
+
+ list_for_each_entry(ev, &catch_all, catchall.list)
+ ubusd_send_event_msg(&ub, cl, ev->obj, id, data);
+
+ obj_event_seq++;
+
+ /*
+ * Since this tree is sorted alphabetically, we can only expect to find
+ * matching entries as long as the number of matching characters
+ * between the pattern string and our string is monotonically increasing.
+ */
+ avl_for_each_element(&patterns, ev, pattern.avl) {
+ const char *key = ev->pattern.avl.key;
+ int cur_match_len;
+ bool full_match;
+
+ full_match = strmatch_len(id, key, &cur_match_len);
+ if (cur_match_len < match_len)
+ break;
+
+ match_len = cur_match_len;
+
+ if (!full_match) {
+ if (!ev->pattern.partial)
+ continue;
+
+ if (match_len != strlen(key))
+ continue;
+ }