[sr-dev] git:master:f757a5e1: dlgs: update final stats when item is destroyed

Daniel-Constantin Mierla miconda at gmail.com
Mon Jun 29 07:36:08 CEST 2020


Module: kamailio
Branch: master
Commit: f757a5e1a092bff4a1dbaa7da2d02f06e3a3e32e
URL: https://github.com/kamailio/kamailio/commit/f757a5e1a092bff4a1dbaa7da2d02f06e3a3e32e

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2020-06-29T07:35:30+02:00

dlgs: update final stats when item is destroyed

---

Modified: src/modules/dlgs/dlgs_records.c

---

Diff:  https://github.com/kamailio/kamailio/commit/f757a5e1a092bff4a1dbaa7da2d02f06e3a3e32e.diff
Patch: https://github.com/kamailio/kamailio/commit/f757a5e1a092bff4a1dbaa7da2d02f06e3a3e32e.patch

---

diff --git a/src/modules/dlgs/dlgs_records.c b/src/modules/dlgs/dlgs_records.c
index e62bd2c97e..3180fa02a2 100644
--- a/src/modules/dlgs/dlgs_records.c
+++ b/src/modules/dlgs/dlgs_records.c
@@ -437,8 +437,9 @@ int dlgs_del_item(sip_msg_t *msg)
 	idx = dlgs_get_index(hid, dsht->htsize);
 
 	/* head test and return */
-	if(dsht->slots[idx].first == NULL)
+	if(dsht->slots[idx].first == NULL) {
 		return 0;
+	}
 
 	lock_get(&dsht->slots[idx].lock);
 	it = dsht->slots[idx].first;
@@ -456,6 +457,7 @@ int dlgs_del_item(sip_msg_t *msg)
 				it->next->prev = it->prev;
 			dsht->slots[idx].esize--;
 			lock_release(&dsht->slots[idx].lock);
+			dlgs_update_stats(&dsht->fstats, it->state, 1);
 			dlgs_item_free(it);
 			return 0;
 		}
@@ -687,6 +689,7 @@ void dlgs_ht_timer(unsigned int ticks, void *param)
 						it->prev = ite->prev;
 					}
 				}
+				dlgs_update_stats(&_dlgs_htb->fstats, ite->state, 1);
 				dlgs_item_free(ite);
 			}
 		}




More information about the sr-dev mailing list