/* fallthrough */
case 1: /* ref updated, item inserted */
rep->rrsets[i] = rep->ref[i].key;
- }
- /* if ref was updated make sure the message ttl is updated to
- * the minimum of the current rrsets. */
- lock_rw_rdlock(&rep->ref[i].key->entry.lock);
- if(rep->ref[i].key->id != 0 &&
- rep->ref[i].id == rep->ref[i].key->id) {
+ /* ref was updated; make sure the message ttl is
+ * updated to the minimum of the current rrsets. */
+ lock_rw_rdlock(&rep->ref[i].key->entry.lock);
/* if deleted, skip ttl update. */
- ttl = ((struct packed_rrset_data*)rep->rrsets[i]->entry.data)->ttl;
- if(ttl < min_ttl) min_ttl = ttl;
+ if(rep->ref[i].key->id != 0 &&
+ rep->ref[i].id == rep->ref[i].key->id) {
+ ttl = ((struct packed_rrset_data*)
+ rep->rrsets[i]->entry.data)->ttl;
+ if(ttl < min_ttl) min_ttl = ttl;
+ }
+ lock_rw_unlock(&rep->ref[i].key->entry.lock);
}
- lock_rw_unlock(&rep->ref[i].key->entry.lock);
}
if(min_ttl < rep->ttl) {
rep->ttl = min_ttl;