Browse code

dlgs: update final stats when item is destroyed

Daniel-Constantin Mierla authored on 28/06/2020 13:19:42
Showing 1 changed files
... ...
@@ -437,8 +437,9 @@ int dlgs_del_item(sip_msg_t *msg)
437 437
 	idx = dlgs_get_index(hid, dsht->htsize);
438 438
 
439 439
 	/* head test and return */
440
-	if(dsht->slots[idx].first == NULL)
440
+	if(dsht->slots[idx].first == NULL) {
441 441
 		return 0;
442
+	}
442 443
 
443 444
 	lock_get(&dsht->slots[idx].lock);
444 445
 	it = dsht->slots[idx].first;
... ...
@@ -456,6 +457,7 @@ int dlgs_del_item(sip_msg_t *msg)
456 456
 				it->next->prev = it->prev;
457 457
 			dsht->slots[idx].esize--;
458 458
 			lock_release(&dsht->slots[idx].lock);
459
+			dlgs_update_stats(&dsht->fstats, it->state, 1);
459 460
 			dlgs_item_free(it);
460 461
 			return 0;
461 462
 		}
... ...
@@ -687,6 +689,7 @@ void dlgs_ht_timer(unsigned int ticks, void *param)
687 687
 						it->prev = ite->prev;
688 688
 					}
689 689
 				}
690
+				dlgs_update_stats(&_dlgs_htb->fstats, ite->state, 1);
690 691
 				dlgs_item_free(ite);
691 692
 			}
692 693
 		}