diff --git a/lib/isc/include/isc/task.h b/lib/isc/include/isc/task.h index bd6d984e46..2cf4e151b3 100644 --- a/lib/isc/include/isc/task.h +++ b/lib/isc/include/isc/task.h @@ -186,7 +186,8 @@ isc_task_purgerange(isc_task_t *task, void *sender, isc_eventtype_t first, * * Notes: * Events whose sender is 'sender', and whose type is >= first and - * <= last will be purged. A sender of NULL will match any sender. + * <= last will be purged, unless they are marked as unpurgable. + * A sender of NULL will match any sender. * * Requires: * @@ -206,7 +207,8 @@ isc_task_purge(isc_task_t *task, void *sender, isc_eventtype_t type); * * Notes: * Events whose sender is 'sender', and whose type is 'type' - * will be purged. A sender of NULL will match any sender. + * will be purged, unless they are marked as unpurgable. + * A sender of NULL will match any sender. * * This function is equivalent to * diff --git a/lib/isc/task.c b/lib/isc/task.c index e41fa525af..179938fd3b 100644 --- a/lib/isc/task.c +++ b/lib/isc/task.c @@ -346,7 +346,8 @@ isc_task_purgerange(isc_task_t *task, void *sender, isc_eventtype_t first, /* * Events matching 'sender' and whose type is >= first and - * <= last will be purged. sender == NULL means "any sender". + * <= last will be purged, unless they are marked as unpurgable. + * sender == NULL means "any sender". * * Purging never changes the state of the task. */ @@ -360,7 +361,9 @@ isc_task_purgerange(isc_task_t *task, void *sender, isc_eventtype_t first, event = next_event) { next_event = NEXT(event, link); if ((sender == NULL || event->sender == sender) && - event->type >= first && event->type <= last) { + event->type >= first && + event->type <= last && + (event->attributes & ISC_EVENTATTR_NOPURGE) == 0) { DEQUEUE(task->events, event, link); ENQUEUE(purgeable, event, link); }