|
@@ -80,7 +80,7 @@ void Subscription_generateKeepAlive(UA_Subscription *subscription) {
|
|
|
void Subscription_updateNotifications(UA_Subscription *subscription) {
|
|
|
UA_MonitoredItem *mon;
|
|
|
//MonitoredItem_queuedValue *queuedValue;
|
|
|
- UA_unpublishedNotification *msg = NULL;
|
|
|
+ UA_unpublishedNotification *msg = NULL, *tempmsg;
|
|
|
UA_UInt32 monItemsChangeT = 0, monItemsStatusT = 0, monItemsEventT = 0;
|
|
|
UA_DataChangeNotification *changeNotification;
|
|
|
size_t notificationOffset;
|
|
@@ -105,9 +105,8 @@ void Subscription_updateNotifications(UA_Subscription *subscription) {
|
|
|
// FIXME: This is hardcoded to 100 because it is not covered by the spec but we need to protect the server!
|
|
|
if(Subscription_queuedNotifications(subscription) >= 10) {
|
|
|
// Remove last entry
|
|
|
- LIST_FOREACH(msg, &subscription->unpublishedNotifications, listEntry)
|
|
|
- LIST_REMOVE(msg, listEntry);
|
|
|
- UA_free(msg);
|
|
|
+ LIST_FOREACH_SAFE(msg, &subscription->unpublishedNotifications, listEntry, tempmsg)
|
|
|
+ Subscription_deleteUnpublishedNotification(msg->notification->sequenceNumber, subscription);
|
|
|
}
|
|
|
|
|
|
if(monItemsChangeT == 0 && monItemsEventT == 0 && monItemsStatusT == 0) {
|