Skip to content

Commit

Permalink
refactor(server): Remove unused UA_EventFilterResult from UA_Notifica…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
jpfr committed Dec 16, 2023
1 parent 0020043 commit d4477fe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/server/ua_subscription.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ typedef struct UA_Notification {

#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS
UA_Boolean isOverflowEvent; /* Counted manually */
UA_EventFilterResult result;
#endif
} UA_Notification;

Expand Down
13 changes: 8 additions & 5 deletions src/server/ua_subscription_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,16 @@ UA_MonitoredItem_addEvent(UA_Server *server, UA_MonitoredItem *mon,

/* The MonitoredItem must be attached to a Subscription. This code path is
* not taken for local MonitoredItems (once they are enabled for Events). */
UA_assert(mon->subscription);
UA_Subscription *sub = mon->subscription;
UA_assert(sub);

UA_Session *session = sub->session;
UA_StatusCode retval = filterEvent(server, session, event,
eventFilter, &notification->data.event,
&notification->result);

UA_EventFilterResult res; /* FilterResult contains only statuscodes. Ignored
* outside the initial setup/validation. */
UA_EventFilterResult_init(&res);
UA_StatusCode retval = filterEvent(server, session, event, eventFilter,
&notification->data.event, &res);
UA_EventFilterResult_clear(&res);
if(retval != UA_STATUSCODE_GOOD) {
UA_Notification_delete(notification);
if(retval == UA_STATUSCODE_BADNOMATCH)
Expand Down
1 change: 0 additions & 1 deletion src/server/ua_subscription_monitoreditem.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ UA_Notification_delete(UA_Notification *n) {
#ifdef UA_ENABLE_SUBSCRIPTIONS_EVENTS
case UA_ATTRIBUTEID_EVENTNOTIFIER:
UA_EventFieldList_clear(&n->data.event);
UA_EventFilterResult_clear(&n->result);
break;
#endif
default:
Expand Down

0 comments on commit d4477fe

Please sign in to comment.