}
if (p->reg->PendingChangeNotifications != NULL) {
- /* we need to process a LIST */
- result = witness_create_notify_response(p,
- WITNESS_NOTIFY_RESOURCE_CHANGE,
- p->reg->PendingChangeNotifications->ResourceName,
- p->reg->PendingChangeNotifications->NewState,
- NULL,
- r->out.response);
- if (!W_ERROR_IS_OK(result)) {
- r->out.result = result;
- goto reply;
+ struct ChangeNotification *reg;
+
+ for (reg = p->reg->PendingChangeNotifications; reg != NULL; reg = reg->next) {
+ result = witness_create_notify_response(p,
+ WITNESS_NOTIFY_RESOURCE_CHANGE,
+ p->reg->PendingChangeNotifications->ResourceName,
+ p->reg->PendingChangeNotifications->NewState,
+ NULL,
+ r->out.response);
+ if (!W_ERROR_IS_OK(result)) {
+ r->out.result = result;
+ goto reply;
+ }
+ DLIST_REMOVE(p->reg->PendingChangeNotifications, reg);
}
- DLIST_REMOVE(p->reg->PendingChangeNotifications, p->reg->PendingChangeNotifications);
} else if (p->reg->PendingMoveNotification != NULL) {
/* we need to process ONE response */