/*
* The "first" entry is cached here so that we can detect when it changes. The insert / delete
* code can just do its work without worrying about timers. And then when the tree manipulation
- * is done, call the fr_bio_dedup_reset_timer() function to reset (or not) the timer.
+ * is done, call the fr_bio_dedup_timer_reset() function to reset (or not) the timer.
*
* The timer is set for is when the first packet expires.
*/
static ssize_t fr_bio_dedup_write(fr_bio_t *bio, void *packet_ctx, void const *buffer, size_t size);
static ssize_t fr_bio_dedup_blocked(fr_bio_dedup_t *my, fr_bio_dedup_entry_t *item, ssize_t rcode);
static void fr_bio_dedup_release(fr_bio_dedup_t *my, fr_bio_dedup_entry_t *item, fr_bio_dedup_release_reason_t reason);
-static int fr_bio_dedup_reset_timer(fr_bio_dedup_t *my);
+static int fr_bio_dedup_timer_reset(fr_bio_dedup_t *my);
-static inline void fr_bio_dedup_reset_timer_item(fr_bio_dedup_t *my, fr_bio_dedup_entry_t *item)
+static inline void fr_bio_dedup_timer_reset_item(fr_bio_dedup_t *my, fr_bio_dedup_entry_t *item)
{
if (my->first != item) return;
my->first = NULL;
- (void) fr_bio_dedup_reset_timer(my);
+ (void) fr_bio_dedup_timer_reset(my);
}
/** Move an item from active to replied.
* The packets will be expire when the pending queue is flushed, OR when the application
* cancels the pending packet.
*/
- fr_bio_dedup_reset_timer_item(my, item);
+ fr_bio_dedup_timer_reset_item(my, item);
fr_bio_dedup_list_insert_tail(&my->pending, item);
item->state = FR_BIO_DEDUP_STATE_PENDING;
/** Reset the timer after changing the rb tree.
*
*/
-static int fr_bio_dedup_reset_timer(fr_bio_dedup_t *my)
+static int fr_bio_dedup_timer_reset(fr_bio_dedup_t *my)
{
fr_bio_dedup_entry_t *first;
case FR_BIO_DEDUP_STATE_REPLIED:
(void) fr_rb_remove_by_inline_node(&my->rb, &item->node);
- if (reason != FR_BIO_DEDUP_EXPIRED) fr_bio_dedup_reset_timer_item(my, item);
+ if (reason != FR_BIO_DEDUP_EXPIRED) fr_bio_dedup_timer_reset_item(my, item);
break;
/*
*/
if (!my->first || (my->first != fr_rb_first(&my->rb))) {
my->first = NULL;
- (void) fr_bio_dedup_reset_timer(my);
+ (void) fr_bio_dedup_timer_reset(my);
}
return out_rcode;
item->state = FR_BIO_DEDUP_STATE_ACTIVE;
(void) fr_rb_insert(&my->rb, item);
}
- (void) fr_bio_dedup_reset_timer(my);
+ (void) fr_bio_dedup_timer_reset(my);
} else {
/*
*/
case FR_BIO_DEDUP_STATE_REPLIED:
(void) fr_rb_remove_by_inline_node(&my->rb, &item->node);
- fr_bio_dedup_reset_timer_item(my, item);
+ fr_bio_dedup_timer_reset_item(my, item);
break;
/*
fr_bio_dedup_release(my, item, FR_BIO_DEDUP_EXPIRED);
}
- (void) fr_bio_dedup_reset_timer(my);
+ (void) fr_bio_dedup_timer_reset(my);
}
/** Write raw data to the bio.
my->first = NULL;
- return fr_bio_dedup_reset_timer(my);
+ return fr_bio_dedup_timer_reset(my);
}